Problem: How do I keep the screen always in Landscape mode?
Description:
I have an activity which should always be displayed in Landscape mode. So I added
android:screenOrientation="landscape"
But When the tablet is moved upside done (inverted or rotate the device by 180 degrees) the application doesnt flip but stays locked in the same position. But in landscape mode itself it should work with either edge in the bottom.
To better understand what I am saying,
- Load the app.
- Now flip it – Camera on the bottom for your device (say for example tablet).
- The screen doesnt flip like it should. The screen is locked in the same orientation as if the camera was up.
Now Try the same experiment on your home screen (Native home of android) and you will see it flip.
Solution:
Just add this orientation instead of android:screenOrientation=”landscape”:
android:screenOrientation="sensorLandscape" // for both landscape and reverseLandscape