解决crash

This commit is contained in:
renhaoting 2025-12-09 14:39:35 +08:00
parent 06fc43a454
commit 0d31395d7a
3 changed files with 18 additions and 15 deletions

View File

@ -92,8 +92,9 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
private fun initAddSubTaskViews() {
val taskStateHelper = TaskManager.instance().boxTaskStatus()
val currentBoxState = taskStateHelper.getStatusBean().tasks[taskStateHelper.getCurrentBoxIndex()]
var subTaskIndex = taskStateHelper.getCurrentBoxIndex()
if (subTaskIndex >= 0) {
val currentBoxState = taskStateHelper.getStatusBean().tasks[subTaskIndex]
currentBoxState.tasks.forEachIndexed { index, subTask ->
val separateLine = View(this@BenefitActivity)
separateLine.setBackgroundResource(R.color.gray_f2)
@ -110,6 +111,8 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
}
}
}
private fun handleActionButClicked(taskType: Int) {
when (taskType) {
BOX_SUB_TASK_TYPE_AD -> {

View File

@ -74,7 +74,7 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
AndroidUtil.openUrl(VidiConst.URL_GAME)
},
PopMenuIconView.MenuItem(R.mipmap.home_menu_4) {
Router.Benefit.startActivity(requireActivity())
Router.ZeroBuy.startActivity(requireActivity())
}
))

View File

@ -136,7 +136,7 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
return index
}
}
return -1
return 0
}
fun getCurrentBoxState(): TaskStateBox? {