Skip to content

Instantly share code, notes, and snippets.

@gnuton
Created June 21, 2013 06:34
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 gnuton/5829298 to your computer and use it in GitHub Desktop.
Save gnuton/5829298 to your computer and use it in GitHub Desktop.
Get orientation on Android
/*Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
int rotation = display.getRotation();
Log.d(TAG, "Orientation " + rotation);
If in portrait mode
if (rotation == Surface.ROTATION_180 || rotation == Surface.ROTATION_0 )*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment