PhoneGap - Forcing Landscape orientation
Have you tried this?
android:screenOrientation="portrait"
Inside the AndroidManifest.xml
file, where you have declared your activity, just add the above line.
For example:
<activity android:name=".Activity.SplashScreenActivity" android:label="@string/app_name" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
The correct way to do this for all devices is to configure config.xml
<preference name="orientation" value="portrait" /><preference name="orientation" value="landscape" />
It is very simple, you need to add android:screenOrientation="landscape"
in your AndroidManifest
.xml file.
<application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".LogUploaderActivity" android:label="Log Uploader" android:screenOrientation="landscape" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>