fixed settings apply confirm dialog crash on some devices
This commit is contained in:
parent
ef1c334200
commit
68b34edecf
|
@ -258,13 +258,17 @@ class SettingsActivity : BaseActivity(), OnItemClickListener, OnPreferenceStartF
|
|||
|
||||
private fun notifyUnsavedChange(): Boolean {
|
||||
if (isTopSettings && (shouldRecreate || shouldRestart || shouldTerminate)) {
|
||||
val df = RestartConfirmDialogFragment()
|
||||
df.arguments = Bundle {
|
||||
this[EXTRA_SHOULD_RECREATE] = shouldRecreate
|
||||
this[EXTRA_SHOULD_RESTART] = shouldRestart
|
||||
this[EXTRA_SHOULD_TERMINATE] = shouldTerminate
|
||||
executeAfterFragmentResumed {
|
||||
if (it.isFinishing) return@executeAfterFragmentResumed
|
||||
it as SettingsActivity
|
||||
val df = RestartConfirmDialogFragment()
|
||||
df.arguments = Bundle {
|
||||
this[EXTRA_SHOULD_RECREATE] = it.shouldRecreate
|
||||
this[EXTRA_SHOULD_RESTART] = it.shouldRestart
|
||||
this[EXTRA_SHOULD_TERMINATE] = it.shouldTerminate
|
||||
}
|
||||
df.show(it.supportFragmentManager, "restart_confirm")
|
||||
}
|
||||
df.show(supportFragmentManager, "restart_confirm")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue