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:
Konrad Pozniak 2025-01-29 20:04:37 +01:00 committed by GitHub
commit 19041d7992
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(