What is the difference between screenOrientation portrait and userPortrait

Libin picture Libin · Apr 29, 2014 · Viewed 7.7k times · Source

I need know the real difference of screen orientation userPortrait and portrait. When to use what?

When this?

 android:screenOrientation="portrait"

When this?

 android:screenOrientation="userPortrait"

Answer

Sajad Karuthedath picture Sajad Karuthedath · Apr 29, 2014
"portrait"  Portrait orientation (the display is taller than it is wide).

and

"userPortrait"  

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

check http://developer.android.com/guide/topics/manifest/activity-element.html