I need to know if night mode is activated, with a boolean or int, I found a boolean that detects but it only works from andorid R isnightmodeactive () and I can't find another way to know if night mode is activated or not, any idea
I did this test but I continue as before it does not throw anything, I do not know how to know what mode my device is in, night or day
public double isDark(int a) {
return a;
}
public void nightmode(){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES){
isDark(1);
}else if(AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO){
isDark(2);
}
}