AppCompatDelegate.setDefaultNightMode does not apply theme to all the activites

47 views Asked by At

After changing the theme using AppCompatDelegate.setDefaultNightMode, the change is visible there, but upon returning to the previous activity, the theme remains unchanged. This issue occurs on the Android emulator (Pixel 5 with API 33), while it works correctly on a Pixel 6 Pro with API 34, and also works correctly on an emulated Pixel 6 Pro API 33.

According to the documentation, setDefaultNightMode() should automatically apply changes to all started activities from AppCompat v1.1.0-alpha05 onwards. Can anyone explain why this isn't happening on the API 33 emulator?

EDIT: I've just deleted the Pixel 5 API 33 emulator, and created a new one (again a Pixel 5 with API 33). I tried it again, and it just works as expected. Should I worry about the problem being reproducible in any other devices in the future?

0

There are 0 answers