Almighty Bus Error

Loading search...

Android Snippet: Fixed Orientation

To lock an Activity’s screen orientation (Portrait or Landscape) you need to use the
following snippet:

// You can use ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE to lock landscape.

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

Tags:  Android Snippet