From 400ee808e08055fcbec4304a5488dbe38afa8a04 Mon Sep 17 00:00:00 2001 From: devlearner Date: Sat, 15 Oct 2022 23:34:39 +0800 Subject: [PATCH] Set up theme/locale before super.create() This seems to solve a bug where the Open action menu dialog does not appear the first time on cold start on older Android (8.0). This is also the order of things in MainActivity and probably good practice. --- .../main/java/org/schabi/newpipe/RouterActivity.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/RouterActivity.java b/app/src/main/java/org/schabi/newpipe/RouterActivity.java index 936beecff..b012be109 100644 --- a/app/src/main/java/org/schabi/newpipe/RouterActivity.java +++ b/app/src/main/java/org/schabi/newpipe/RouterActivity.java @@ -114,6 +114,11 @@ public class RouterActivity extends AppCompatActivity { @Override protected void onCreate(final Bundle savedInstanceState) { + ThemeHelper.setDayNightMode(this); + setTheme(ThemeHelper.isLightThemeSelected(this) + ? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark); + Localization.assureCorrectAppLanguage(this); + super.onCreate(savedInstanceState); Icepick.restoreInstanceState(this, savedInstanceState); @@ -125,11 +130,6 @@ public class RouterActivity extends AppCompatActivity { finish(); } } - - ThemeHelper.setDayNightMode(this); - setTheme(ThemeHelper.isLightThemeSelected(this) - ? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark); - Localization.assureCorrectAppLanguage(this); } @Override