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,519
  • 5
  • 37
  • 47
user1042757
  • 119
  • 8

3 Answers3

2

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

aganders3
  • 5,636
  • 25
  • 30
1

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

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

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

Wizetux
  • 746
  • 3
  • 12