Lock orientation of the screen for your app

In AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.android.myapp">

    <application
        android:allowBackup="true"
        tools:ignore="GoogleAppIndexingWarning">

        <!-- Screen locked to landscape for easier play -->
        <!-- configChanges attribute makes the following actions NOT cause a config change  -->
        <!-- screenOrientation attribute sets the default animation-->
        <activity android:name=".MainActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:screenOrientation="landscape">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>