From 3aa1a68cdcbfe25c9269e23760687ed0d45a8d6c Mon Sep 17 00:00:00 2001 From: RikkaW Date: Wed, 27 Oct 2021 01:12:32 +0800 Subject: [PATCH] Fix activity relaunches constantly on WSA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's magic 💢 since change configuration should not trigger activity relaunch. --- app/src/main/java/com/topjohnwu/magisk/core/App.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/App.kt b/app/src/main/java/com/topjohnwu/magisk/core/App.kt index 2acf21c70..d4842c06a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/App.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/App.kt @@ -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) }