Browse Source

1.网络变动时重新拉取策略。

20241218TB223FC(测试jar包)
wangwanlei 8 months ago
parent
commit
20fd29ff9e

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

118
 
118
 
119
     //标记是否请求了应用策略,都为真则提示
119
     //标记是否请求了应用策略,都为真则提示
120
     private var updateStrategyFlag = false
120
     private var updateStrategyFlag = false
121
+
122
+    //标记启动时是否有网络
123
+    private var hasNetFlag = true
121
     //标记当前是否锁定
124
     //标记当前是否锁定
122
     private var mainLockFlag=false
125
     private var mainLockFlag=false
123
     private var autoAppFlag=true
126
     private var autoAppFlag=true
792
         if (!screenFlag){
795
         if (!screenFlag){
793
             if (!NetworkUtils.isAvailable(this)){
796
             if (!NetworkUtils.isAvailable(this)){
794
                 showTipsDialog(getString(R.string.checknettips))
797
                 showTipsDialog(getString(R.string.checknettips))
798
+                useTimeStrategy()
799
+                hasNetFlag=false
795
             }
800
             }
796
             Const.backNum++
801
             Const.backNum++
797
         }
802
         }
1388
 
1393
 
1389
             Const.STARTSOCKET -> {
1394
             Const.STARTSOCKET -> {
1390
                 AppSocket.startSocket(this)
1395
                 AppSocket.startSocket(this)
1396
+                if(!hasNetFlag){
1397
+                    hasNetFlag=true
1398
+                    updateAllStrategy()
1399
+                }
1391
             }
1400
             }
1392
 
1401
 
1393
             Const.ACTION_SCREEN_ON->{
1402
             Const.ACTION_SCREEN_ON->{

Loading…
Cancel
Save