3

I'm making an android app but it works best if the phone/tablet is flipped horizontal.. how do I make the screen lock at that and make it to where it doesn't flip going vertical?

theisenp
  • 8,639
  • 5
  • 39
  • 47
user1042757
  • 119
  • 9

3 Answers3

2

Set android:screenOrientation="landscape" in the <activity> element of your AndroidManifest.xml file.

aganders3
  • 5,838
  • 26
  • 30
1

A quick search through past Stack Overflow questions turns up this answer:

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
Community
  • 1
  • 1
theisenp
  • 8,639
  • 5
  • 39
  • 47
0

Another option is to only define a activity layout for the landscape orientation. res/layouts-landscape.

Wizetux
  • 756
  • 3
  • 12