Skip to content

Instantly share code, notes, and snippets.

@redbluenat
Created October 17, 2019 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redbluenat/efa69c364a99628d4b7b166d97006815 to your computer and use it in GitHub Desktop.
Save redbluenat/efa69c364a99628d4b7b166d97006815 to your computer and use it in GitHub Desktop.
@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