Skip to content

Instantly share code, notes, and snippets.

@codeswimmer
Created March 11, 2011 21:09
Show Gist options
  • Save codeswimmer/866582 to your computer and use it in GitHub Desktop.
Save codeswimmer/866582 to your computer and use it in GitHub Desktop.
Android: determine current screen orientation
public static final int determineCurrentScreenOrientation(Context context) {
Display display = ((WindowManager) context.getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
int orientation = display.getOrientation();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment