tags:

views:

168

answers:

1

Hi,

I have a camera preview activity, which is forced to stay in landscape mode.

Is there a way I can tell the current orientation of the phone (not the screen orientation).

Basically I want to know if the user is holding the phone in portrait mode, or in landscape mode, so I can rotate the output captured bitmap correctly (right now it just always outputs in landscape mode).

Thanks

A: 

You can also implement Application.onConfigurationChanged() to respond to orientation changes without having to register a SensorEventListener. It might be an easier way to go if you want to customize the layout depending on the phone orientation.

Erich Douglass