Skip to content

Instantly share code, notes, and snippets.

@tuankma
Last active January 2, 2016 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuankma/8253580 to your computer and use it in GitHub Desktop.
Save tuankma/8253580 to your computer and use it in GitHub Desktop.
Get Auto-Rotate Information On/Off Using Settings.System.ACCELEROMETER_ROTATION
if (android.provider.Settings.System.getInt(getContentResolver(),Settings.System.ACCELEROMETER_ROTATION, 0) == 1){
Toast.makeText(Rotation.this, "Rotation ON", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(Rotation.this, "Rotation OFF", Toast.LENGTH_SHORT).show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment