- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Balises:
- HTML5
- Intel® XDK
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
navigator.app.exitApp();
This code closes the app... but it still appears in the list of applications running
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Paul... very good explanation.
Tanks!
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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 <
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.

- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable