I\'m using Androids built in day/night mode functionality and I\'d like to add an option to my app for AppCompatDelegate.MODE_NIGHT_AUTO
I\'m having a p
A very simple solution is to add a string resource like this.
res/values/strings.xml
Day
res/values-night/strings.xml
Night
And then wherever you need to check it:
if (resources.getString(R.string.mode) == "Day") {
// Do Day stuff here
} else {
// Do night stuff here
}
But you CAN NOT call this before super.onCreate() in an activity's life-cycle. It will always return "Day" before onCreate.