Skip to content

Commit

Permalink
android: add screenSize to AndroidManifest's configChanges (thanks, D…
Browse files Browse the repository at this point in the history
…aniel!).

Fixes Bugzilla #3448.

"Starting with Android API 13, another configuration change must be declared
to be handled by the app if it is desired to not let the system handle
rotation itself:

https://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange

This will have effect if either a developer or SDL per default will set target
API > 12. Currently it is set to 12, but this might change in the future, like
when applying this patch: https://bugzilla.libsdl.org/show_bug.cgi?id=3445

The effect of not having this change applied is that the SDL app is destroyed
upon rotation. Even when the manifest has an additional entry to e.g. always
stay in landscape mode, the onDestroy() call will happen on devices that are
portrait per default, when switching off screen due to power save. The device
will then (at least try to) rotate into portrait to show the portrait screen
lock after resume.

I believe it is safe to apply this patch even with target API still set to 12,
the additional parameter is simply ignored."
  • Loading branch information
icculus committed May 19, 2017
1 parent e889757 commit a9c7bc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion android-project/AndroidManifest.xml
Expand Up @@ -36,7 +36,7 @@
android:hardwareAccelerated="true" >
<activity android:name="SDLActivity"
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation"
android:configChanges="keyboardHidden|orientation|screenSize"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down

0 comments on commit a9c7bc8

Please sign in to comment.