Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lock Android phone application to Portrait mode

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

like image 574
sexitrainer Avatar asked Feb 18 '11 17:02

sexitrainer


People also ask

How do I force an app to stay in portrait mode?

On the main screen of Rotation Manager, select an orientation by tapping on either the vertical or horizontal icons next to a specific app to lock it into either landscape or portrait mode. Highlighting both icons will allow that particular app to auto-rotate.

How do I lock my android screen from portrait?

Open Quick settings again. Whether you are holding your device upwards or sideways, swipe down from the top of the screen. Tap the Auto rotate icon to lock your device in your desired position. Remember, Portrait is when the device is upwards, and Landscape is when the device is sideways.


2 Answers

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

<activity android:name=".yourActivity" android:screenOrientation="portrait"... /> 
like image 163
techiServices Avatar answered Sep 21 '22 09:09

techiServices


Yes! It's an attribute of the activity tag:

<activity android:name=".yourActivity" android:screenOrientation="portrait" ... /> 
like image 32
Francesco Laurita Avatar answered Sep 22 '22 09:09

Francesco Laurita