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
If you want to avoid Activity recreations you could set the flag on the Application class as mentioned here
I recommend setting it in your application class (if you have one) like so:
public class MyApplication extends Application {
public void onCreate() {
super.onCreate();
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}
}