Browse Source

1.延迟网络连接弹窗提示时间。

0423x6e6f
wangwanlei 3 weeks ago
parent
commit
2dcf953500

+ 8
- 1
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt View File

@@ -971,9 +971,16 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
971 971
         }
972 972
         if (!screenFlag) {
973 973
             if (!NetworkUtils.isAvailable(this)) {
974
-                showTipsDialog(getString(R.string.checknettips))
975 974
                 useTimeStrategy()
976 975
                 hasNetFlag = false
976
+                lifecycleScope.launch {
977
+                    withContext(Dispatchers.IO){
978
+                        delay(2000)
979
+                        if (!NetworkUtils.isAvailable(applicationContext)){
980
+                            showTipsDialog(getString(R.string.checknettips))
981
+                        }
982
+                    }
983
+                }
977 984
             }
978 985
             Const.backNum++
979 986
         }

Loading…
Cancel
Save