Android app crashing on orientation change in SDK 13

151 views
Skip to first unread message

Anneleen Vaes

unread,
May 21, 2013, 10:14:03 PM5/21/13
to phon...@googlegroups.com
So I noticed that my Android app crashes when changing the orientation if the android:targetSdkVersion is 13 or higher. No idea why, so maybe you can help me. Here's the content of my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="be.z33.mobile"
    android:installLocation="preferExternal"
    android:versionCode="3"
    android:versionName="1.2" >
   
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="12"/>
   
    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:resizeable="true"
        android:anyDensity="true"
        android:xlargeScreens="true" />
       
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <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.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.telephony" android:required="false" />

    <application
        android:icon="@drawable/z33icon"
        android:label="@string/app_name"
        android:allowBackup="true">
        <activity
            android:name=".App"
            android:label="@string/app_name"
            android:configChanges="orientation|keyboardHidden" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="org.apache.cordova.DroidGap"
            android:label="@string/app_name"
            android:configChanges="orientation|keyboardHidden"
            android:exported="false" >
            <intent-filter/>
        </activity>
    </application>

</manifest>

Simon MacDonald

unread,
May 22, 2013, 12:34:59 AM5/22/13
to phonegap
It is because you did not update the configChanges in your manifest.
It should be:

android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"

Simon Mac Donald
http://hi.im/simonmacdonald
> --
> -- You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>
> To compile in the cloud, check out build.phonegap.com
> ---
> You received this message because you are subscribed to the Google Groups
> "phonegap" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phonegap+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Anneleen Vaes

unread,
May 22, 2013, 9:52:35 PM5/22/13
to phon...@googlegroups.com
Tried that, but I get an error when I apply screenSize. Probably because my android:minSdkVersion is 8? However I do have to target a lot of devices for my app. Also I can't change the SDK level in the properties, cause Eclipse freezes when I try.

Simon MacDonald

unread,
May 22, 2013, 11:37:15 PM5/22/13
to phonegap
Your manifest should use:

<uses-sdk

android:minSdkVersion="8"

android:targetSdkVersion="17" />

and you wont' get the configChanges error.
Simon Mac Donald
http://hi.im/simonmacdonald


Reply all
Reply to author
Forward
0 new messages