I am working on an Android project where I need to support switching between Dark/Light themes based on system setting preference.
I have changed App Theme from Theme.AppCompat.Light.NoActionBar
to Theme.AppCompat.DayNight.NoActionBar
.
I am using this API on Application onCreate()
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
App theme is getting updated only when I restart app but does not update when I am within the app when theme is changed from system setting.
Am I missing any config changes?