I am new to the phone. I prepared one sample application. My application has 2 pages, the first page has one button, when clicked, the second page opens. It works fine using the following
function callAnothePage() { window.location = "test.html"; }
There is one button on the second page, when I click on it I want to exit the application. I used the following
function exitFromApp() { navigator.app.exitApp(); }
test.html code,
<!DOCTYPE html> <html> <head> <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script> <script type="text/javascript" charset="utf-8"> function onLoad() { console.log("device reday !!!!") document.addEventListener("deviceready", onDeviceReady, true); } function exitFromApp() { console.log("in button"); navigator.app.exitApp(); } </script> </head> <body onload="onLoad();"> <h4><center>Login Page</center></h4> <input type="submit" onclick="exitFromApp()" value="exit"/> </body> </html>
But it does not work.
android cordova phonegap-plugins
user1651572 Sep 06 '12 at 10:00 2012-09-06 10:00
source share