MikeS
MikeS

Reputation: 3921

Android App Landscape Only

I want to make my App landscape only, so I am using the method provided here: i want to make my application only in landscape in android

In short, I am adding android:screenOrientation="landscape" to my manifest file.

It is partially working, but the problem is that it only allows the user to use the app in one of the two landscape orientations. How can I tell the app that it is allowed to use either of the landscape orientations?

(testing on Nexus 7 4.2)

Upvotes: 4

Views: 6360

Answers (3)

Ryan Heitner
Ryan Heitner

Reputation: 13632

There is also "userLandscape" - as per documentation

Landscape orientation, but can be either normal or reverse landscape based on the device sensor and the user's sensor preference. If the user has locked sensor-based rotation, this behaves the same as landscape, otherwise it behaves the same as sensorLandscape. Added in API level 18.

Upvotes: 1

Androider
Androider

Reputation: 2804

Use android:screenOrientation="sensorLandscape" but it will work only if you are building your project on Android 2.3 or above.

Upvotes: 10

zapl
zapl

Reputation: 63945

android:screenOrientation has several options you can find in the documentation

What you probably want is

  • "sensorLandscape"
    Landscape orientation, but can be either normal or reverse landscape based on the device sensor. Added in API level 9.

Upvotes: 1

Related Questions