Fix activity relaunches constantly on WSA

It's magic 💢 since change configuration should not trigger activity relaunch.
This commit is contained in:
RikkaW 2021-10-27 01:12:32 +08:00 committed by John Wu
parent f94452083f
commit 3aa1a68cdc

View File

@ -67,7 +67,9 @@ open class App() : Application() {
}
override fun onConfigurationChanged(newConfig: Configuration) {
resources.updateConfig(newConfig)
if (resources.configuration.diff(newConfig) != 0) {
resources.updateConfig(newConfig)
}
if (!isRunningAsStub)
super.onConfigurationChanged(newConfig)
}