Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

For Android applications, you can limit the view of an application to either "landscape" or "potrait" exclusively; in essence disabling rotation for your application.

To do this, find the main activity in your AndroidManifest.xml (it should be visible at the bottom of your project folder in Eclipse) and add the following line:

android:screenOrientation="portrait"

or

 android:screenOrientation="landscape"

So, your activity section in your xml should look something like this:

<activity
     android:name=".Common2013"
     android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
     android:label="@string/title_activity_main"
     android:screenOrientation="portrait">
     <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
</activity>
  • No labels