fix MainActivity not restarting when theme changes (#4900)
`EXTRA_RESTART_ON_BACK` is never set on the Intent extras, but `intent.extras?.getBoolean(EXTRA_RESTART_ON_BACK)` will return `false` as long as there are any extras, hiding the actual value from the `savedInstanceState`.
This commit is contained in:
parent
2cc47396bd
commit
19041d7992
1 changed files with 1 additions and 3 deletions
|
|
@ -92,9 +92,7 @@ class PreferencesActivity :
|
|||
}
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, restartActivitiesOnBackPressedCallback)
|
||||
restartActivitiesOnBackPressedCallback.isEnabled = intent.extras?.getBoolean(
|
||||
EXTRA_RESTART_ON_BACK
|
||||
) ?: savedInstanceState?.getBoolean(EXTRA_RESTART_ON_BACK, false) ?: false
|
||||
restartActivitiesOnBackPressedCallback.isEnabled = savedInstanceState?.getBoolean(EXTRA_RESTART_ON_BACK, false) == true
|
||||
}
|
||||
|
||||
override fun onPreferenceStartFragment(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue