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 {
|
private fun notifyUnsavedChange(): Boolean {
|
||||||
if (isTopSettings && (shouldRecreate || shouldRestart || shouldTerminate)) {
|
if (isTopSettings && (shouldRecreate || shouldRestart || shouldTerminate)) {
|
||||||
val df = RestartConfirmDialogFragment()
|
executeAfterFragmentResumed {
|
||||||
df.arguments = Bundle {
|
if (it.isFinishing) return@executeAfterFragmentResumed
|
||||||
this[EXTRA_SHOULD_RECREATE] = shouldRecreate
|
it as SettingsActivity
|
||||||
this[EXTRA_SHOULD_RESTART] = shouldRestart
|
val df = RestartConfirmDialogFragment()
|
||||||
this[EXTRA_SHOULD_TERMINATE] = shouldTerminate
|
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 true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue