Manage device orientation
When we develop Android applications that target an API level equal or higher than 13, we must include the screenSize value to the android:configChanges attribute in the AndroidManifest.xml file. Otherwise, the application fails to run properly when the device orientation changes.
Assuming that IBM MobileFirst Platform Foundation is the first main activity in the AndroidManifest.xml file of the application:
- If the target API is equal or higher than 13, add the screenSize value to the android:configChanges attribute of the <activity> element, as shown in the following example:
<activity android:name=".worklightStarter" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden|screenSize" android:launchMode="singleTask">
- If the target API is smaller than 13, the activity always handles this configuration change itself, and you do not need to add the screenSize value to the <activity> element.
Parent topic: Develop hybrid applications for Android