I\'m trying to temporarily lock the orientation of the Android device, where most of the time it changes with the sensor. So what I want to do is figure out what the current
I found another simple solution on this website: http://sagistech.blogspot.ch/2010/12/finding-android-screen-orientation.html
There are multiple way to get Android screen orientation (landscape/portrait), however some of them are problematic: this.getWindowManager().getDefaultDisplay().getOrientation() Is deprecated
this.getWindowManager().getDefaultDisplay().getRotation() Works only from Android 2.2
I Found this to be the best resource until now, since it's exists since API 1 & it's not deprecated, yet: this.getResources().getConfiguration().orientation
Compare it with:
- Configuration.ORIENTATION_LANDSCAPE
- Configuration.ORIENTATION_SQUARE
- Configuration.ORIENTATION_PORTRAIT
For me it worked.