[android-developers] Inconsistent behavior on orientation changes between API versions
Hi,
Sorry for the previous incomplete message.
I have an activity with a quite complex view hierarchy that I'm
attempting to avoid being recreated each time the orientation changes
(locking the orientation is NOT an option). I added the usual
android:configChanges="keyboard|keyboardHidden|orientation"
attributes and implemented onConfigurationChanged in the activity.
Everything goes smoothly if I declare the API compatibility as
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="12" />
If I change it to targetSdkVersion to 13 or higher the UI gets
"frozen" for a while each time the orientation changes and the
following messages are shown in the log:
I/InputReader( 251): Reconfiguring input devices. changes=0x00000004
I/InputReader( 251): Device reconfigured: id=7,
name='mxt224_ts_input', surface size is now 480x800, mode is 1
I/ActivityManager( 251): Config changed: {1.0 0mcc0mnc pt_BR sw320dp
w533dp h294dp nrml long land finger -keyb/v/h -nav/h s.48}
D/SizeAdaptiveLayout( 326):
com.android.internal.widget.SizeAdaptiveLayout@416757e0child view
android.widget.FrameLayout@416bf788 measured out of bounds at 95px
clamped to 96px
D/SizeAdaptiveLayout( 326):
com.android.internal.widget.SizeAdaptiveLayout@41b52be8child view
android.widget.FrameLayout@416ce1e8 measured out of bounds at 95px
clamped to 96px
W/WindowManager( 251): App freeze timeout expired.
W/WindowManager( 251): Force clearing freeze: AppWindowToken{420dd4e0
token=Token{41802280 ActivityRecord{418baf30
com.example.test/.MainActivity}}}
D/dalvikvm( 4299): GC_FOR_ALLOC freed 318K, 22% free 10388K/13255K,
paused 25ms, total 30ms
I suspect that it is caused by a slow recalculation of the layout
geometry but I don't understand why android:targetSdkVersion triggers
the bug.
I have seen this on a Nexus S, running Android 4.1.1.
--
"The flames are all long gone, but the pain lingers on"
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home