Search code examples
androidtabsorientationportrait

Samsung Galaxy Tab portrait orientation problems


I making an app and im currently optimizing it to Samsung Galaxy Tab. I have a little problem here, when i launch the application, it is came up in only one portrait orientation.

I use this code:

android:screenOrientation="portrait"

It is only working with one portrait screen orientation, so if i rotate the device to upside down, its now changing. Its a little annoying, because if i start the application in the wrong orientation, my app came up in upside down and wont change.

What can i do with this ?


Solution

  • You can try Activity. setRequestedOrientation(int)

    The parameter can be either ActivityInfo.SCREEN_ORIENTATION_PORTRAIT or ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT