Setting targetSdkVersion="13" causes Activities to ignore android:configChanges="orientation" flag
Asked Answered
A

2

14

It appears that API level 13 has ("silently" as far as I can tell) introduced a change to how android:configChanges attribute is handled.

In my particular case, when "targetSdkVersion" in the app manifest is set to "13" any activities that are configured to internally handle orientation changes (e.g. should not be restarted on screen rotation) are being always restarted regardless of the android:configChanges="orientation" attribute in their declarations.

A simple switch of the "targetSdkVersion" to "12" restores the expected behavior.

I searched the API 13 release notes and could not find any mention of such change. Does anyone know if API 13 (and possibly later APIs) will by design not support android:configChanges="orientation", or if there is another approach to achieve this.

Abb answered 27/7, 2011 at 17:28 Comment(0)
A
13

Looks like there is some new documentation for configChanges, specifically referring to HONEYCOMB_MR2 release. Maybe you can try using orientation|screenSize|smallestScreenSize, see if that changes behavior. Hope that at least leads you in the proper direction.

Aurthur answered 27/7, 2011 at 18:38 Comment(2)
Indeed the combination of "orientation|screenSize" did the trick (smallestScreenSize does not seem to matter). Thank you very much for pointing me in the right direction.Abb
Apparently this setting is not inherited by sub activities :( - hence I need to set it for each and every activity oOGuthrey
P
0

try this: <android:configChanges="orientation|screenSize"/>

Psittacosis answered 6/2, 2014 at 13:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.