Hi everyone, this is my first question on StackOverflow.
Now I am making an application with Cordova 3.2 using Telerik AppBulider, and I ran into a problem on Android.
The application should not be killed when it was placed in the background. The application works great if I put it in the background and re-open it using the multitask menu. However, if I open it again using the application icon in the drawer, the application will restart.
This only happens on Android (2.3, 4.4, have not tried others). No problem with iOS.
I tried Google for a solution, and most of them brought me the following:
<preference name="KeepRunning" value="true"/>
which was documented in Cordoba 3.2 Documentation , here is my config.xml after adding:
<?xml version="1.0" encoding="utf-8"?>
<cordova>
<access origin="*"/>
<content src="index.html" />
<log level="DEBUG"/>
<preference name="KeepRunning" value="true"/>
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
</cordova>
But that does not help.
I am already listening to both the suspension and the resumption of events.
document.addEventListener('deviceready', function() {
document.addEventListener('pause', aFunction, false);
document.addEventListener('resume', anotherFunction, false);
}, false);
How can I prevent the application from restarting when the application is reopened using the application icon? Thank:)