My app has many dialogs. When I change the orientation of the device, the dialog disappears along with the content entered, because activity restart is triggered on orientation change. I have two choices: save the content of every dialog in variables and when activity restarts I reopen the one that was opened and refill it. This creates a LOT of boilerplate code and it also gets confusing a bit with many dialogs. My other solution is to use android:configChanges="orientation"
in the manifest file, which will prevent activity restart. (My layout doesn't change on different orientations so it's okay) But many people suggested that this is a bad practice, as it prevents the activity from restarting on other configuration changes.
Is there a way to prevent activity restart only on orientation change and keep it on other configuration changes?