AppCompatDelegate.MODE_NIGHT_AUTO is not updating my existing activity and I'm not sure why.
I dynamically allow the user to change night mode. If the user changes the mode to auto I set the default night mode then recreate the activity:
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
recreate();
If I change to MODE_NIGHT_YES or MODE_NIGHT_NO, it works as expected. If I change to MODE_NIGHT_AUTO, it goes to the correct dark/light theme, but then it fails to update the activity after the transition from day to night. It kind of sucks to test this because I have to wait for sunrise/sunset (EDIT: apparently I can manually change the time on the device rather than having to wait...so long as the location permission is not used).
Do I have to do a manual check for the night mode flag in onresume and manually update resources for existing activities, or am I doing something wrong? If I rotate the device and the activity is recreated after sunset then the dark theme is correctly picked up, but before rotation it will still be showing the light theme.
Support lib 23.4.0, Android version 6.0.