Search code examples
androidandroid-manifestandroid-orientation

Making Android app portrait only makes it one-way portrait


I've made my app portrait-only and it works successfully, however there seems to be a cache. I can only have this kind of orientation:

[Image]

But I can't rotate it 180°, it just shows like this:

But if I leave the app, the screen rotates. So the problem is, it seems that the app is being set to one-way portrait, is there a way to fix it? Here's how I'm setting portrait-only in each activity:

android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"

Is there an option to fix this?


Solution

  • Try using this instead...

    android:screenOrientation="sensorPortrait"
    

    If this doesn't work let me know!

    Edit So people see this, it only works with API 9+ as @AbAppletic said in the comments below.