how to auto rotate screen android studio code example
Example 1: android studio turn off screen rotation
<!-- inside of your AndroidManifest.xml -->
<activity android:name=".MainActivity"
android:screenOrientation="portrait"/>
Example 2: how to rotate screen in android studio
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);