Skip to content

Instantly share code, notes, and snippets.

@jlehman
Created February 6, 2013 20:41
Show Gist options
  • Select an option

  • Save jlehman/4725617 to your computer and use it in GitHub Desktop.

Select an option

Save jlehman/4725617 to your computer and use it in GitHub Desktop.
String orientation = getString(R.string.orientation);
Log.i("Orientation String",orientation);
if (orientation == "portrait") {
Log.i("Orientation String","SHOULD LOCK TO PORTRAIT");
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} else {
Log.i("Orientation String","SHOULD LOCK TO LANDSCAPE");
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment