- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See this post, I think it is what you are looking for: https://software.intel.com/en-us/forums/intel-xdk/topic/593293
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This method will exit but the App will still in background.
It there any way to fully exit app even not in background?
I found a reference like this.
http://stackoverflow.com/questions/36129144/how-to-fully-exit-android-application-in-phonegap
I change the code in CoreAndroid.java but it is still in background.
Please help.
Thank.
Matrix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was going to suggest killing the app programmatically but that is not good practice and might risk your app getting rejected by the store.
I don't think there is a way to exit the app from running in the background. Maybe you can try disabling the javascript from running when the app is in the background. Try this thread: https://groups.google.com/forum/?fromgroups=#!topic/phonegap/8_XUXo0yOWQ
It has a few suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for replying.
Yes, normally it is not.
But after a lot of trying, I found the way to exit from background.
Add a window.close() can solve this problem.
I made a exitAppFromBackground() function for it.
The source code as below for your further test and reference.
// Name: exitFromBackground() // Author: Matrix Lee // Function: Exit app, and remove it from the background. function exitAppFromBackground(){ window.close(); if(navigator.app){ navigator.app.exitApp(); }else if(navigator.device){ navigator.device.exitApp(); } }
Matrix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have used this command to exit:
navigator.app.exitApp();
But... just to Android. As far as I know, Apple do not permit this. In my apps, when running under iOS, I hidden the button EXIT.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page