Skip to content Skip to sidebar Skip to footer

Phonegap Android Application Restarting Instead Of Resuming, Although It Was Not Killed By The Os

I have created an Phonegap 1.5/Android application. My client reports that, when he leaves the app using the Home button, and then relaunches it using the app icon, the app relaunc

Solution 1:

You want to add the following to the activity tag in your AndroidManifest.xml:

android:launchMode="singleTask"

So it should look like this:

<activity android:name="MyApp" android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar"
    android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
    android:launchMode="singleTask">

Check out this page for more information on launchMode: http://www.intridea.com/blog/2011/6/16/android-understanding-activity-launchmode

Solution 2:

Hey Lucas do you have:

android:configChanges="orientation|keyboardHidden"

in your activity tag in your AndroidManifest.xml.

As you said the other thing that could be happening is your client's phone is running low on memory and the OS is killing your app to free up memory.

Solution 3:

This is actually by design in Android, where the OS controls the life cycle of the application. You can find more information here.

Solution 4:

Give it a try...

Use android:launchMode="singleInstance" in activity tag of your manifest file.

Solution 5:

I have a Samsung Galaxy Note II and I encountered the same problem. So, I modified the AndroidManifest.xml and now it works both on Samsung and HTC Thunderbolt.

Here are the modifications:

<uses-featureandroid:name="android.hardware.camera"android:required="false"/><uses-sdkandroid:minSdkVersion="7"android:targetSdkVersion="10"/><activityandroid:configChanges="orientation|keyboardHidden" />

Post a Comment for "Phonegap Android Application Restarting Instead Of Resuming, Although It Was Not Killed By The Os"