tags:

views:

837

answers:

5

How do I make sure my app is only for vertical layout?
I added this android:screenOrientation="portrait" but that doesn't seem to do the trick.

+2  A: 

That is "the trick", if by "the trick" you want to ignore orientation changes and always be set for portrait orientation. See this sample project that demonstrates the technique.

CommonsWare
+4  A: 

You need to add to all your activity not for one only. I think you understood that setting is per application wide, but it isn't.

android:screenOrientation="portrait"
Pentium10
+2  A: 

Add android:configChanges="keyboardHidden|orientation" to the activity.

Chris Smith
+1  A: 

Just to confirm Pentium10's answer. I was having a similar issue and adding android:screenOrientation="portrait" to the tag did the trick for me.

Bill
+1  A: 

android:orientation="vertical" put this attribute in layout root,try it it may help.

Kantesh