Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

Code Block

android:screenOrientation="portrait"

or

Code Block
  android:screenOrientation="landscape"

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

Code Block

<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>

...