update:2020.05.23
fix:toast显示问题 add:
This commit is contained in:
@@ -28,14 +28,20 @@ public class ToastUtil {
|
||||
|
||||
}
|
||||
|
||||
private static long time1 = 0L;
|
||||
private static long time2 = 0L;
|
||||
|
||||
public static void show(final String msg) {
|
||||
mainHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
showToast(mContext, msg, Toast.LENGTH_LONG);
|
||||
Log.e("fht", "LENGTH_LONG");
|
||||
|
||||
time2 = System.currentTimeMillis();
|
||||
if ((time2 - time1) > 3499) {
|
||||
showToast(mContext, msg, Toast.LENGTH_LONG);
|
||||
Log.e("fht", "LENGTH_LONG");
|
||||
time1 = time2;
|
||||
}
|
||||
} else {
|
||||
if (toast != null) {
|
||||
toast.setText(msg);
|
||||
|
||||
Reference in New Issue
Block a user