Created
October 17, 2019 15:51
-
-
Save redbluenat/efa69c364a99628d4b7b166d97006815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
switch (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) { | |
case Configuration.UI_MODE_NIGHT_YES: | |
setTheme(R.style.DarkTheme); | |
break; | |
case Configuration.UI_MODE_NIGHT_NO: | |
setTheme(R.style.LightTheme); | |
break; | |
default: | |
setTheme(R.style.LightTheme); | |
} | |
SplashScreen.show(this, true); | |
super.onCreate(savedInstanceState); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment