android studio blocking rotation code example
Example 1: android disable landscape mode
<activity android:name=".SomeActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" />
Example 2: how to prevent screen rotating in app android studio
android:screenOrientation="portrait or landscape"