Search code examples
performanceandroidandroid-windowmanager

How to keep a Android app in landscape


I want to know if there was good way to keep my application from rotating, but let it go switch from landscape to landscape reversed?

I've only found this:

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

How can I restrict my applications to those two states?


Solution

  • Don't wanna say it but RTM !

    Here, in your Manifest add this to your activity you wanna let rotate :

    android:screenOrientation="sensorLandscape"