是否可以在退出时停止应用?我在Phonegap中有以下代码来监控后退按钮点击,我希望它在退出时停止应用 - 如果可能的话?
document.addEventListener("backbutton", backKeyDown, true);
function backKeyDown() {
if($.mobile.activePage.is('#homepage')){
setTimeout( function() {navigator.app.exitApp();}, 100 );
}
else {
setTimeout( function() {$.mobile.changePage("#homepage");}, 100 );
}
}
干杯 保罗
答案 0 :(得分:-2)
以下方法可能对您有用。
BackButton.override();
BackButton.exitApp();