Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable rotating to landscape mode? [duplicate]

Tags:

I tried this. Could not find configChanges in manifest file. Anyways, how to disable rotation of screen(to landscape mode)?

    <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.joericharduz.akita"     android:versionCode="1"     android:versionName="1.0" >      <uses-sdk         android:minSdkVersion="8"         android:targetSdkVersion="17" />      <application         android:allowBackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name"         android:theme="@style/AppTheme" >         <activity             android:name="com.joericharduz.akita.MainActivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>  </manifest> 
like image 924
Joe Rakhimov Avatar asked Aug 12 '13 14:08

Joe Rakhimov


People also ask

Why is my screen rotating the wrong way?

Turn On Screen Rotation From Android Settings Launch the Settings app on your Android phone. Tap Display in the list of items. Turn on the option that says Auto-rotate screen.


2 Answers

Just as kalyanpvs has said, the configChanges are under activity:

<application     android:allowBackup="true"     android:icon="@drawable/ic_launcher"     android:label="@string/app_name"      android:theme="@style/AppTheme">     <activity         android:name="com.neundorfer.microraphandheld.v1.ParentActivity"         android:label="@string/app_name"          android:screenOrientation="portrait"> 
like image 179
TronicZomB Avatar answered Oct 05 '22 19:10

TronicZomB


Just add android:screenOrientation="portrait" to your Manifest. Easiest way to do it (inside your Activity tags).

like image 28
whitfin Avatar answered Oct 05 '22 18:10

whitfin