Android application restarts on orientation change

If your android targetSdkVersion is 12 or less, add the android:configChanges="orientation|keyboardHidden" property to your android manifest.

If your android targetSdkVersion is 13 or more, use orientation|keyboardHidden|screenSize as the value for android:configChanges.

Overall it should look like this:

<activity android:name=".MyActivity" android:configChanges="<your value here>">

Leave a Comment