Search code examples
androidandroid-orientation

app in all orientations


I would like my app to work in all possible orientations - portrait, reverse portrait, landscape and reverse landscape. I haven't put down anything in my manifest that locks the orientations like. All the orientations work well on Samsung Galaxy Tab 7, but reverse portrait doesn't work in Samsung Galaxy S4 & S3 mini!!

If there a setting which prevents these app from going to reverse portrait orientation on phones? (The same happens with Google Maps app. It works in reverse portrait in the the tablet but not in the phones)


Solution

  • You can add a flag to your manifest if you would like to force this behavior:

    <activity
        android:screenOrientation="fullSensor"
        ... />
    

    From the documentation:

    The orientation is determined by the device orientation sensor for any of the 4 orientations. This is similar to "sensor" except this allows any of the 4 possible screen orientations, regardless of what the device will normally do (for example, some devices won't normally use reverse portrait or reverse landscape, but this enables those). Added in API level 9.