5

Is there way to get information if device settings is enable to locked screen orientation?

CoDe
  • 11,056
  • 14
  • 90
  • 197

1 Answers1

5

You can check the value of Settings.System.ACCELEROMETER_ROTATION setting like so:

final int rotationState = android.provider.Settings.System.getInt(
    getContentResolver(), 
    Settings.System.ACCELEROMETER_ROTATION, 0
);

When the auto-rotation is enabled, this value equals to 1 (and 0 otherwise).

aga
  • 27,954
  • 13
  • 86
  • 121