I need to know if user has enabled dark theme in the OS level so that I can enable dark theme in my app automatically.(not force dark mode)
To detect if the system is in dark theme. Helpful.
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;
}