steliosf
steliosf

Reputation: 3869

Device Rotation on fixed orientation Android

I'm displaying a camera activity in Android 2.2 and I lock the screen orientation in landscape mode. Is there a way to get the device rotation?

I mean, getOrientation() always returns LANDSCAPE and getRotation() always returns 1. How can I get the actual rotation of the device even if I lock the orientation in landscape mode?

Upvotes: 1

Views: 1325

Answers (1)

Emmanuel Sys
Emmanuel Sys

Reputation: 815

You can use the SensorManager class, see http://www.workingfromhere.com/blog/2009/03/30/orientation-sensor-tips-in-android/

Upvotes: 1

Related Questions