switch (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) { case Configuration.UI_MODE_NIGHT_YES: //process break; case Configuration.UI_MODE_NIGHT_NO: // process break; }