-2

I know there are two other posts like this one and hear me out I've tried their codes and well I can't get my Application to lock into landscape mode.

I have put in screen orientation in the Java manifest and still nothing. Here's the code.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.anthonypalmer.tappydefender">
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:screenOrientation="landscape"
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <!--
    ATTENTION: This was auto-generated to add Google Play services to your project for
    App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information.
    -->
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
Samuel Liew
  • 76,741
  • 107
  • 159
  • 260

1 Answers1

1

you put your attibutes on the wrong place. android:theme and android:screenOrientation are 'Neighbors'of android:name of the <activity>-section:

 <activity
        android:name=".MainActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:screenOrientation="landscape">
termigrator
  • 159
  • 3
  • 11