Lock Android phone application to Portrait mode

sexitrainer picture sexitrainer · Feb 18, 2011 · Viewed 70.2k times · Source

Can someone tell me how to lock my application to a portrait mode? Is it a simple configuration in the manifest file?

Answer

techiServices picture techiServices · Feb 18, 2011

Yes. Add android:screenOrientation="portrait" to the manifest under your main activity.

<activity android:name=".yourActivity" android:screenOrientation="portrait"... />