lock/unlock orientation

Viewed 8568

To lock my orientation to portrait, I use:

activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

I'm unsure what flag tells the activity to go back to relying on the device orientation. I imagine it is one of these:

SCREEN_ORIENTATION_FULL_SENSOR
SCREEN_ORIENTATION_SENSOR
SCREEN_ORIENTATION_UNSPECIFIED
SCREEN_ORIENTATION_USER


On another note, why isn't the android documentation open source? The documentation is completely lacking. Very few of the functions and flags have useful descriptions.

3 Answers

If the "android:immersive"attribute is set to"true " in the app's manifest entryfor this activity, the ActivityInfo.flagsmember always has its FLAG_IMMERSIVE bit set, even if the immersive mode is changed at runtime using the "setImmersive()" method.

Related