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?
您可以使用SensorManager
类,请参见http://www.workingfromhere.com/blog/2009/03/30/orientation-sensor-tips-in-android/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.