How to fix layout orientation to vertical?

Harinder picture Harinder · Apr 18, 2011 · Viewed 84.9k times · Source

How to fix layout orientation to portrait and do not allow changing from portrait to landscape during run time?

Answer

Jim Blackler picture Jim Blackler · Apr 18, 2011

In your AndroidMainfest.xml file find the tags of the activities you wish to lock to a given rotation, and add this attribute:

android:screenOrientation="portrait"