By default an Activity support both Portrait and Landscape mode. On changing the orientation of the device, view rotates accordingly. However in certain apps or certain screens, we may want to limit the orientation to Portrait or Landscape. We can do the so by specifying the Android attribute screenOrientation to portrait or landscape as part of the Activity definition.


<activity android:name=".activity.AudioPlayerScreen"
android:label="Audio Player" android:screenOrientation="portrait">
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>

This will set the orientation of Audio Player Screen to Portrait mode only.