phonegap navigator.app.exitApp() is not working

66 views
Skip to first unread message

Jaya kumar

unread,
Apr 26, 2015, 7:24:19 PM4/26/15
to phon...@googlegroups.com
Hi,
phonegap navigator.app.exitApp() is not working, iam trying a lot but still i can't, please tell me the version of cordova jar and js file,
sorry for my bad english.
Thanks,
Jay

svkirans

unread,
Apr 27, 2015, 11:14:45 AM4/27/15
to phon...@googlegroups.com
Is it on iOS or Android ? On iOS, there is no exit and so the exitApp call doesn't really exit :)

Jean Pokou

unread,
Apr 29, 2015, 3:50:46 PM4/29/15
to phon...@googlegroups.com
your code /* navigator.app.exitApp */ should be placed in the device ready events to make sure cordova has already loaded
Let's say I want to close the app on backButton press, it should be written like that
$(document).ready(function () {
document.addEventListener("backbutton", onBackButton, false);

}
// function for handling back button events
function onBackButton() {     
if(navigator)
navigator.app.exitApp();
}
Reply all
Reply to author
Forward
0 new messages