Answer the question
In order to leave comments, you need to log in
How to change android screen orientation using only native code?
I need to switch to landscape mode for my game. I only use native c++ code without java.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.habebu.podval"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto"
android:screenOrientation="landscape"> <!-- НЕ РАБОТАЕТ -->
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.hardware.usb.host"
android:required="false" />
<uses-feature
android:name="android.hardware.type.pc"
android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:hardwareAccelerated="true" >
<activity
android:name="LaunchActivity"
android:screenOrientation="landscape"></activity>
<activity android:name="showimageActivity"
android:label="@string/app_name"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Answer the question
In order to leave comments, you need to log in
android:screenOrientation="landscape"> <!-- НЕ РАБОТАЕТ -->
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question