I'm writing an application for an Android Tablet. I want the ScreenOrientation always to be in "Landscape", but the app should be able to rotate 180°. If you hold the Tablet upside down, the View should be displayed correctly and rotate 180°.
Is there a simple way to do this? At the moment I'm forcing the app to be in landscape mode only within the Manifest I wrote android:screenOrientation="landscape"
for the activity. But the rotation won't work like that.
Use Rotation Control to force screen orientation of Android devices. Once you've installed, open the app and just tap to turn it on. You can even start it when you restart your phone. This will help you when you don't want to open the again and again after every reboot.
If you want to develop an application in portrait mode, add screenOrientation inside application tag. In the above result it is showing only portrait mode. now turn your device it not going to change the view according to orientation.
Use android:screenOrientation="sensorLandscape"
instead.
Landscape orientation, but can be either normal or reverse landscape based on the device sensor. Added in API level 9.
See Dev Guide
Note that if you use android:configChanges="orientation"
to avoid screen rotation in the activity tag, the screen will not rotate at all. If you want it to rotate only in landscape, use the option described above and remove the orientation flag. Check what is the behaviour you want before using this option or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With