Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable auto rotation screen - Android [duplicate]

Tags:

java

android

Possible Duplicate:
How to set android show vertical orientation?

I'm trying to disable auto rotation when I run my application in Android. Maybe, I should add a line code in AndroidManifest.xml Anyone know How can I do that ?

like image 316
Anass Avatar asked Sep 20 '11 12:09

Anass


People also ask

How do I stop my screen from rotating automatically?

To adjust the screen rotation settings: Swipe down from the top of the screen to open the Quick settings panel. Look for the screen orientation icon. Depending on your settings, you may need to look for the Portrait, Landscape, or Auto Rotate icon.

How do I stop my screen from rotating on certain apps?

How do I stop my screen from rotating on certain apps? To access the Accessibility features on your Android device open the Settings app. In the Settings app, select Accessibility from the list. Now scroll down to the Interaction controls section and select Auto-rotate screen to set the toggle switch to Off.

How do I stop my screen from rotating on my Samsung phone?

Swipe down from the top of the screen to open the Quick settings panel. Tap More options (the three vertical dots), and then tap Edit buttons. Touch and hold the Auto rotate icon, and then drag it to your desired position.

How do you calibrate Auto rotate on Android?

Turn On Screen Rotation From Android Settings In case you have a non-functional tile in Quick Settings, this method should fix your problem. Launch the Settings app on your Android phone. Tap Display in the list of items. Turn on the option that says Auto-rotate screen.


1 Answers

Add something like android:screenOrientation="portrait" or android:screenOrientation="landscape" in the AndroidManifest.xml:

<activity android:name=".MyActivity"
          android:label="@string/app_name"
          android:screenOrientation="portrait">
like image 77
nhaarman Avatar answered Sep 30 '22 18:09

nhaarman