Search code examples
androidsdklandscapescreen-orientation

android:screenOrientation="sensorLandscape" showing error for a project with the minimum SDK as 2.2


I'm trying to set android:screenOrientation="sensorLandscape" for one of my activities, to enable landscape left and landscape right.

In my project properties, I've set the project build target to Android 2.2. In my manifest, the minimum SDK version is set to Android 2.2 as well (API level 8): The line in my manifest is:

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10"/>

According to the docs, the "sensorLandscape" attribute should be available to me, but still, when I try setting it, the error I get is "error: Error: String type not allowed (at "screenOrientation" with value "sensorLandscape")".

Am I missing some extra setting somewhere?


Solution

  • "sensorLandscape":Landscape orientation, but can be either normal or reverse landscape based on the device sensor.Added in API level 9. so i think your minsdkVersion should be 9 instead of 8...