|
@@ -14,6 +14,7 @@ import com.xhkjedu.manageapp.databinding.ItemAppBinding
|
14
|
14
|
import com.xhly.corelib.Const
|
15
|
15
|
import com.xhly.corelib.bean.AppInfo
|
16
|
16
|
import com.xhly.corelib.eventbus.UIEvent
|
|
17
|
+import com.xhly.corelib.utils.AppUtils
|
17
|
18
|
import com.xhly.corelib.utils.LogShow
|
18
|
19
|
import com.xhly.corelib.utils.SystemUtil
|
19
|
20
|
import com.xhly.manageapp.utils.InstallUtils
|
|
@@ -66,6 +67,10 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
|
66
|
67
|
context.startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
|
67
|
68
|
}else if (appInfo.packageName.equals(Const.STOREAPPPKG)){
|
68
|
69
|
//跳转应用商店
|
|
70
|
+ if (!AppUtils.isAppInstalled(context,appInfo.packageName)){
|
|
71
|
+ Toaster.show("应用正在安装,请稍后。")
|
|
72
|
+ return@setOnClickListener
|
|
73
|
+ }
|
69
|
74
|
var destroyFlag=false
|
70
|
75
|
try {
|
71
|
76
|
val launchIntent = Intent()
|
|
@@ -79,7 +84,7 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
|
79
|
84
|
destroyFlag=true
|
80
|
85
|
}catch (e:Exception){
|
81
|
86
|
destroyFlag=false
|
82
|
|
- Toaster.showLong("失败原因"+e.toString())
|
|
87
|
+ LogShow("失败原因"+e.toString())
|
83
|
88
|
}finally {
|
84
|
89
|
if (destroyFlag){
|
85
|
90
|
DownLoadUtils.destroyDownLoad()
|
|
@@ -88,6 +93,10 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
|
88
|
93
|
}
|
89
|
94
|
} else{
|
90
|
95
|
try {
|
|
96
|
+ if (!AppUtils.isAppInstalled(context,appInfo.packageName)){
|
|
97
|
+ Toaster.show("应用正在安装,请稍后。")
|
|
98
|
+ return@setOnClickListener
|
|
99
|
+ }
|
91
|
100
|
var instance = Calendar.getInstance()
|
92
|
101
|
instance.set(Calendar.HOUR_OF_DAY, 11)
|
93
|
102
|
instance.set(Calendar.MINUTE, 0)
|