While developing an Android app, I've found two ActivityInfo attributes for setting the screen orientation.
The attributes having USER are as follows:
The attributes having SENSOR are as follows:
What is the difference between the SCREEN_ORIENTATION_USER and SCREEN_ORIENTATION_SENSOR?
The attributes having USER are as follows.
SCREEN_ORIENTATION_USER
Use the user's current preferred orientation of the handset. Corresponds to SCREEN_ORIENTATION_USER.
SCREEN_ORIENTATION_USER_LANDSCAPE
Would like to have the screen in landscape orientation, but if the user has enabled sensor-based rotation then we can use the sensor to change which direction the screen is facing. Corresponds to SCREEN_ORIENTATION_USER_LANDSCAPE.
SCREEN_ORIENTATION_USER_PORTRAIT
Would like to have the screen in portrait orientation, but if the user has enabled sensor-based rotation then we can use the sensor to change which direction the screen is facing. Corresponds to SCREEN_ORIENTATION_USER_PORTRAIT.
The attributes having SENSOR are as follows.
SCREEN_ORIENTATION_SENSOR
Orientation is determined by a physical orientation sensor: the display will rotate based on how the user moves the device. Ignores user's setting to turn off sensor-based rotation. Corresponds to SCREEN_ORIENTATION_SENSOR.
SCREEN_ORIENTATION_SENSOR_LANDSCAPE
Would like to have the screen in landscape orientation, but can use the sensor to change which direction the screen is facing. Corresponds to SCREEN_ORIENTATION_SENSOR_LANDSCAPE.
SCREEN_ORIENTATION_SENSOR_PORTRAIT
Would like to have the screen in portrait orientation, but can use the sensor to change which direction the screen is facing. Corresponds to SCREEN_ORIENTATION_SENSOR_PORTRAIT.