android ToastShow 直接切换文字,不闪烁
1、代码
public class ToastUtils {
private static Toast mToast;
public static void showToast(Context context,CharSequence text,int duration){
if (mToast==null) {
mToast=Toast.makeText(context, text, duration);
}else {
mToast.setText(text);
mToast.setDuration(duration);
}
mToast.show();
}
}