Search code examples
javaandroidlibgdxscreenorientation

Java libgdx - set orientation per screen


I have two screens: Menu and Game. How can I set portrait mode for Menu and landscape mode for Game in libGdx?


Solution

  • Setting the android:screenOrientation="portrait" or android:screenOrientation="landscape" in Manifest Android

        <activity android:name=".MenuActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" />
    
        <activity android:name=".GameActivity"
            android:label="@string/app_name"
            android:screenOrientation="landscape" />