public class ToastUtils{
private static Toast toast;
//单例的Toast ,避免重复调用
public static void showToast(Context context, String msg){
if(toast == null){
toast = Toast.makeText(context.getApplicationContext(), msg, Toast.LENGTH_SHORT);
}else{
toast.setText(msg);
}
toast.show();
}
}