Android Switching between Dark/Light themes not working

  android, android-dark-theme, android-darkmode

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()

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?

Source: Android Questions