user1201239 user1201239 - 1 month ago 10
Android Question

Lock the android orientation as landscape throughout the App?

I have checked many question based on this but still I am not able to get it how to lock the screen orientation to landscape through out the app. ?

<activity android:screenOrientation="landscape"
android:name=".BasicLayoutCheckActivity"
/>


this is not working for me it comes back to potrait if another activity is used

Answer

In the Manifest, you can set the screenOrientation to landscape for all the activities . You have placed for one activity so other activities are opening in portrait, So for fixing set all your activities with orientation as your first activity. It would look something like this in the XML:

<activity android:name=".BasicLayoutCheckActivity" android:screenOrientation="landscape"></activity>