Skip to content

Instantly share code, notes, and snippets.

@codeswimmer
Created March 10, 2011 01:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeswimmer/863388 to your computer and use it in GitHub Desktop.
Save codeswimmer/863388 to your computer and use it in GitHub Desktop.
Android: programmatically set screen orientation
Use this to make it landscape:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
...and this to make it portrait:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment