From f94f8531f667c8924398437f47d534ac02e093b1 Mon Sep 17 00:00:00 2001 From: mcarare Date: Fri, 26 Mar 2021 16:04:23 +0200 Subject: [PATCH] For #18496: Set activity theme in onCreate before call to super. --- app/src/main/java/org/mozilla/fenix/HomeActivity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt index abb9b5608..0c610d2b6 100644 --- a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -183,6 +183,8 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { components.strictMode.attachListenerToDisablePenaltyDeath(supportFragmentManager) // There is disk read violations on some devices such as samsung and pixel for android 9/10 components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) { + // Theme setup should always be called before super.onCreate + setupThemeAndBrowsingMode(getModeFromIntentOrLastKnown(intent)) super.onCreate(savedInstanceState) } @@ -198,7 +200,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { components.publicSuffixList.prefetch() - setupThemeAndBrowsingMode(getModeFromIntentOrLastKnown(intent)) setContentView(R.layout.activity_home).run { // Do not call anything between setContentView and inflateNavGraphAsync. // It needs to start its job as early as possible.