In my activity I have a long process which runs in the background using a AsyncTask. A ProgressDialog is displayed while the task is being run. This works fine but if the user rotates the screen while the task is running an error occurs. I want my activity to not restart when the user rotates the screen.
I have added the below to my manifest file but each time the screen is rotated the OnCreate method is still called. (have confirmed by adding a break point in OnCreate which is hit)
android:configChanges="keyboardHidden|orientation|screenSize"
<activity android:name=".MyActivityName" android:configChanges="keyboardHidden|orientation|screenSize">
Any suggestions?