[android-developers] Re: onConfigurationChanged() is not called when flipping between landscape and reverse landscape?
Hi Dianne, your answer isn't good enough.
On flipping, the activity isn't informed through onConfigurationChanged (since Honeycomb, I suppose). This saves an unnecessary onSurfaceChange, texture loading, etc. Cool.
But in that case sensor manager too must provide values as in previous orientation.
Unfortunately it is mangled in accordance to the new orientation.
In NDK, raw sensor vectors aren't officially available in sensor.h.
We use remapCoordinateSystem()[1] when away from default orientation.
We call this on config change to remember the new orientation and compensate for sensor value mangling.
int rotation = activity.getWindowManager().getDefaultDisplay().getRotation()
Even without JNI such a call must be avoided except on config change event.
It is a overkill to (JNI-)call that on each frame just because the framework hides it from the activity but uses the new orientation in sensor value mangling.
Framework must inform the activity of the change if it chooses to alter sensor values by the new (flipped) orientation.
Thanks,
RS
RS
[1] http://developer.android.com/reference/android/hardware/SensorManager.html#remapCoordinateSystem(float[] , int, int, float[])
ps: This is specific to flip... there is no switch between landscape<->portrait but just flipped as in landscape to reverse-landscape or portrait to reverse-portrait.
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