Reputation: 81
Is it possible to make the screen orientation of the background of an xml page remain in portrait even in screen rotation. I tried
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:screenOrientation="portrait"
android:background="@drawable/back">
but it doesn't work. What should i do?
Upvotes: 1
Views: 160
Reputation: 3050
Change in manifest file in activity tag of that specific activity you want to show in portrait mode only
<activity android:name="YourActivitName"
android:screenOrientation="portrait">
</activity>
Upvotes: 3
Reputation: 629
<activity
android:name="your activity and package name like com.example.back"
android:label="@string/app_name"
android:screenOrientation="portrait" >
Upvotes: 1