Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 750
StefanK Avatar asked Jul 27 '11 17:07

StefanK


1 Answers

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.

like image 135
Josh Avatar answered Nov 15 '22 22:11

Josh