You can avoid a restart of your application for certain configuration changes via the configChanges attribute on your activity definition in your
AndroidManifest.xml
. The following activity will not be restarted in case of orientation changes or position of the physical keyboard (hidden / visible).
<activity android:name=".ProgressTestActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden|keyboard">
</activity>
1 comment:
"If your application targets API level 13 or higher (as declared by the minSdkVersion and targetSdkVersion attributes), then you should also declare the "screenSize" configuration, because it also changes when a device switches between portrait and landscape orientations."
So add
android:configChanges="orientation|keyboardHidden|keyboard|screenSize"
Post a Comment