Skip to content

Commit 400ee80

Browse files
devlearnerStypox
authored andcommitted
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.
1 parent 8797669 commit 400ee80

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/RouterActivity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ public class RouterActivity extends AppCompatActivity {
114114

115115
@Override
116116
protected void onCreate(final Bundle savedInstanceState) {
117+
ThemeHelper.setDayNightMode(this);
118+
setTheme(ThemeHelper.isLightThemeSelected(this)
119+
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
120+
Localization.assureCorrectAppLanguage(this);
121+
117122
super.onCreate(savedInstanceState);
118123
Icepick.restoreInstanceState(this, savedInstanceState);
119124

@@ -125,11 +130,6 @@ protected void onCreate(final Bundle savedInstanceState) {
125130
finish();
126131
}
127132
}
128-
129-
ThemeHelper.setDayNightMode(this);
130-
setTheme(ThemeHelper.isLightThemeSelected(this)
131-
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
132-
Localization.assureCorrectAppLanguage(this);
133133
}
134134

135135
@Override

0 commit comments

Comments
 (0)