Android Screen Orientation
is the direction of how an activity or a screen view appears in an application. It can be of four types:
To be added in AndroidManifest.xml:
android:screenOrientation="orientationType"
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.example.myapplication"><applicationandroid:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/Theme.MyApplication"><activity android:name=".MainActivity"android:screenOrientation="landscape"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application></manifest>
AndroidManifest.xml
file
android:screenOrientation="landscape"
However, it is simpler to change the orientation in Android studio.
To do so, execute the following in activity_main.xml
: