1

I'm trying to close my android app by calling cordova navigator.app.close(), app closes but still running in background and I can see it in app manager. I tried to solve this problem like it described there: PhoneGap keep running on Android after onPause by inserting

<preference name="keepRunning" value="false" /> 

in config.xml, but it doesn't work for me.

Are there some other ideas to solve this problem?

Community
  • 1
  • 1
Mary Ryllo
  • 2,321
  • 7
  • 34
  • 53

2 Answers2

2

There doesn't appear to be a function called navigator.app.close(). Did you mean to call navigator.app.exitApp()?

Here is a list of all of the available functions from navigator.app:

navigator.app.backHistory();
navigator.app.cancelLoadUrl();
navigator.app.clearCache();
navigator.app.clearHistory();
navigator.app.exitApp();
navigator.app.loadUrl(url, props);
navigator.app.overrideBackbutton(override);
Joshua
  • 1,260
  • 3
  • 17
  • 33
0

upgrade your Cordova version to 4.0+ and use navigator.app.exitApp();

inspiredMichael
  • 370
  • 4
  • 9