Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app with Phonegap crashes on landscape rotation

I created an Android app with Phonegap. When the app runs and I flip the phone into landscape it simply crashes. I already tried adding this to my manifest:

android:configChanges="orientation|keyboardHidden"

also tried:

android:configChanges="orientation|screenSize|keyboardHidden"

No effect. Any suggestions?


Update:

This is what logcat tells me when the app crashes: http://dl.dropbox.com/u/17844821/zeug/logcat.txt


Update:

This is my manifest file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="de.foo.bar"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="15" />

<supports-screens 
    android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:resizeable="true" 
    android:anyDensity="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:configChanges="orientation|keyboardHidden"
            android:name=".MainActivity"
            android:label="@string/title_activity_main">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>
like image 345
Timo Ernst Avatar asked Dec 20 '25 16:12

Timo Ernst


1 Answers

Make sure that put those in the activity tag like this:

<activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize
|locale">

and close it after them. I have this problem once and I made this mistake.

like image 169
D3GAN Avatar answered Dec 23 '25 06:12

D3GAN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!