I'm creating an app where I use the theme DayNight of the Android support libraries.
This is the code in themes.xml
<style name="ActivityTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
I use configChanges in the manifest to manage rotations.
android:configChanges="keyboardHidden|orientation|screenSize"
In the onCreate on my AppcompatActivity I have added:
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
The problem is that when I use setDefaultNightMode, android:configChanges stops working, and recreate de activity in every rotation.
Any kind of help will be welcome