- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am newly comes to intel XDK application html 5 Development. When i am creating a new android app's in this application contains of multiple page application, I am facing a new problem (ie) how will exit a app on button click now am using a code are listed below
navigator.app.exitApp();
Its not working , if any one know give me correct solution,its very helpfull to me.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are trying to use a function that is part of the Cordova subsystem. If you have a multiple-page app, you must initialize the Cordova subsystem with each new page that is loaded, this is very slow and very inefficient. You should develop your app as a single-page app if you want the underlying Cordova subsystem, including such functions, to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
navigator.app.exitApp();
This code closes the app... but it still appears in the list of applications running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's not a list of "running" apps, but a list of "recently used apps." Android keeps an app in memory, even if it has exited and is no longer running, so that the app may be quickly restarted. It will remove apps from memory (and from that "recently used list") if it needs the space for other apps. So seeing an app in that list is not an indication that it is still running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul... very good explanation.
Tanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When click back button on my app close the app using show pop up box on screen..there is not working properly
<script type="text/javascript">
document.addEventListener("exitButton", function(){
intel.xdk.notification.alert(
'Do you want to quit',
onConfirmQuit,
'QUIT title App',
'OK,Cancel'
);
}, true);
function onConfirmQuit(button){
if(button == "2"){
navigator.app.exitApp();
}
}
</script>
this script not working my Android phone.
please how to solve this problem on intel xdk and android phone also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Probably doesn't work because you may not have the retired intel.xdk.notification plugin in your system? Please use the standard Cordova plugins instead, the old Intel XDK plugins have been retired and are no longer supported. There is a "notification" plugin in the "core" Cordova plugins list that you can use as an alternative to intel.xdk.notifcation.
Also, see this SO post > http://stackoverflow.com/a/36047901/2914328 <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul F. (Intel) wrote:
You are trying to use a function that is part of the Cordova subsystem. If you have a multiple-page app, you must initialize the Cordova subsystem with each new page that is loaded, this is very slow and very inefficient. You should develop your app as a single-page app if you want the underlying Cordova subsystem, including such functions, to work.
Hello Paul,
1. Can you give me a reference code (or link) in how to initialize the cordova subsystem with each new page that is loaded so that I can close my app?
2. If this process is very inefficient, what is the method I must use to close a multiple-page app using the back button?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are building a true multi-page app (multiple html files, each opened as a new "page" in the app), then you need to include a <script> reference to cordova.js in each of those pages. However, this will result in a restart of the underlying Cordova framework. This is not a recommended approach for building Cordova apps (see this Cordova Next Steps article for lots of useful information). I highly recommend that you implement an SPA, as described by the referenced article.
There is no need to close your app using the back button, all the user has to do is "switch away" from the app. If you want to force what the backbutton does, you can trap the event. See this Cordova doc page and search for "backbutton" on the page. You could try using the poorly documented navigator.app.exitApp() function in response to the backbutton event, but I do not know if that function continues to be supported by the most recent versions of Cordova.
![](/skins/images/D3C0B914909A6564BBB97F4AD1ED1973/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page