How can I make it so the screen orientation is always landscape?
Do I need to add something to the manifest.xml
?
Use Rotation Control to force screen orientation of Android devices. Once you've installed, open the app and just tap to turn it on. You can even start it when you restart your phone. This will help you when you don't want to open the again and again after every reboot.
Step 1: Open the base UI layout in DESIGN mode so that you see the actual GUI, such as Buttons, icons, etc. Step 2: Click the icon marked in the below screenshot and, from the menu, select Create Landscape Variation. Then the corresponding Landscape file will be created automatically named as land\xml file name.
Add this android:screenOrientation="landscape"
to your <activity>
tag in the manifest for the specific activity that you want to be in landscape.
Edit:
To toggle the orientation from the Activity
code, call setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
other parameters can be found in the Android docs for ActivityInfo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With