Reputation: 3869
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
Reputation: 815
You can use the SensorManager
class, see http://www.workingfromhere.com/blog/2009/03/30/orientation-sensor-tips-in-android/
Upvotes: 1