I'm trying to implement dark mode in my application and faced strange behavior of the MODE_NIGHT_YES|MODE_NIGHT_NO flags.
I use AppCompatDelegate.setDefaultNightMode(...) to set global dark mode. So when I use MODE_NIGHT_FOLLOW_SYSTEM everything is perfect and works as expected but when I use MODE_NIGHT_YES or MODE_NIGHT_NO my application still reacts on System Dark Mode Toggle settings and recreates my activities when it's happening. I expect that if I set MODE_NIGHT_YES or NO system settings should not affect my application in anyway but it does.
Is this something expected or is it a bug? Also I do not handling uiMode config changes by myself, everything is done by using AppCompatDelegate.setDefaultNightMode(...). But it looks like I should do it to prevent unnecessary activity recreation.