I am trying to set light mode if the default mode is dark mode in my Intro Activity
Intro.java
if(AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_NO)
{
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
this.recreate();
}
But this throws an error:
2020-10-25 07:04:43.626 9167-9167/com.xxxx.xxxxxx E/ActivityInjector: get life cycle exception
java.lang.ClassCastException: android.os.BinderProxy cannot be cast to android.app.servertransaction.ClientTransaction
I am using
Theme.AppCompat.DayNight.NoActionBar
Also the theme doesn't update in the Activity. If anyone knows please help me out on this.