这是我的代码:
function onLoad(){
alert("onLoad");
document.addEventListener("deviceready",onDeviceReady, true);
}
function onDeviceReady(){
navigator.notification.alert("PhoneGap is working!!");
document.addEventListener("backbutton", onBackKeyDown, false);
}
function onBackKeyDown(e) {
navigator.notification.alert("PhoneGap handle back button click!!!");
/* want you to go back???
if yes go back or exit app
*/
}
你能帮帮我吗
/* want you to go back???
if yes go back or exit app
*/
非常感谢。
答案 0 :(得分:0)
function showAlert() {
navigator.notification.confirm(
'Vuoi uscire dall\'applicazione?', // message
onConfirm, // callback to invoke with index of button pressed
'Chiudere?', // title
'Chiudi app,Annulla' // buttonLabels
);
}
function onConfirm(button) {
if(button==1)
navigator.app.exitApp();
}
答案 1 :(得分:0)
navigator.app.exitApp()无法在iOS上运行:(