I created my application before the android pie has been released, in every layout I put android: background = \"white\" it works fine in every device, but when
What suggested by Ali Rezaiyan is the correct way to proceed if you want disable the night mode all over your app.
Sometimes you just need to disable the night mode on some activities or fragment only (maybe because of legacy stuff).
So you can choose what to do:
Disable all over the app:
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)Disable for a single Activity:
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);- After calling this you probably need to call
recreate()for this to take effect