Here is the quick article about how to disable screen orientation change in Android.Well, recently in one application, I want to restrict application with landscape mode only.
User is restricted with portrait orientation so need not change an orientation of screen even if enabled.
So,first of all open your AndroidManifest.xml,find the activity declaration and place below line of code into < activity > tag.
1 2 3 | android:screenOrientation="landscape" |
After adding above line of code, you can see your whole application will be set to landscape
That’s it.I hope this tip will be helpful to you.
Post your comments if you need help. As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.
Comments (1)