It seems when screen orientation changes, the activity’s onCreate() method is called. In my onCreate() method, I have an AlertDialog which pops up when the activity is called. The problem is when I switch the screen sideways, the popup is displayed again.
How can I avoid this?
Modify your
AndroidManifestwith:Your
Activityshould look like this:This will avoid the call to
onCreate()when there is a change in the orientation.