Commit 6f62eced authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 6f21e736
......@@ -487,13 +487,14 @@ class MyFragment : BaseFragment(),
AppConfig.isHighTask = false
mCurrentPkg = null
ps.remove(Constant.HIGH_TASK_PKG_NAME)
}
3 -> {
if (mCurrentPkg == null) {
// 如果当前包名为空,获取本地存储的包名
mCurrentPkg = PreferencesService.getInstance(mContext).getString(Constant.HIGH_TASK_PKG_NAME)
mCurrentPkg = ps.getString(Constant.HIGH_TASK_PKG_NAME, "")
}
if (mCurrentPkg == null) {
if (TextUtils.isEmpty(mCurrentPkg)) {
showToast("任务异常,请重试~")
myPresenter.setHighTaskType("0")
......@@ -1242,7 +1243,7 @@ class MyFragment : BaseFragment(),
try {
val pkg = intent.getStringExtra("pkg")
mCurrentPkg = pkg
PreferencesService.getInstance(mContext).putString(Constant.HIGH_TASK_PKG_NAME, pkg)
ps.put(Constant.HIGH_TASK_PKG_NAME, pkg)
myPresenter.setHighTaskType("3")
} catch (e: Exception) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment