Message info
 
To:android-developers@googlegroups.com From:Mark Carter Subject:[android-developers] Re: How to detect screen rotation through 180 degrees from landscape to landscape orientation? Date:Wed, 28 Mar 2012 23:21:02 -0700 (PDT)
 

In my case, I need to for the camera (otherwise the image will appear upside down).

Some apps (like Paper Camera) get around this by not allowing the screen to rotate, and so the SurfaceView (used by the Camera) is more like a window (through the device).

At risk of this post going off on a tangent, the "window" strategy makes sense. In other words, when the user rotates the screen, leave the SurfaceView as it is and only reposition/redraw the controls. I imagine this is quite hard (because you would be effectively drawing the controls upside down), and so not worth the effort.

Other reasons for caring about which side the screen is up, include anything that uses the orientation sensor, such as games.

On Thursday, March 29, 2012 2:06:51 PM UTC+8, Zsolt Vasvari wrote:
Just curious, why do you care which side of the screen is up? 

On Thursday, March 29, 2012 9:57:14 AM UTC+8, Mark Carter wrote:

I've seen a few other questions similar to this but no answers.

Rotating from portrait to landscape (either direction) and back again, we get the helpful call to onConfigurationChanged().

However, when rotating from landscape to landscape (through 180 degrees) onConfigurationChanged() is not called.

I've seen mention of using OrientationEventListener but this seems flakey to me because you can rotate quickly around without triggering a display orientation change.

I've tried adding a layout change listener, but with no success.

So the question is, how to reliably detect such a change in landscape orientation?

Note: I also posted this on SO: http://stackoverflow.com/questions/9909037/how-to-detect-screen-rotation-through-180-degrees-from-landscape-to-landscape-or

--
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