mui重写安卓手机返回键,使其在导航页面点击两次退出app

var first = null;
mui.back = function(){
console.log("点击了物理返回")
console.log(first);
console.log(!first);
if(!first){
first = new Date().getTime();
mui.toast('再按一次退出应用',{type:'div' });
setTimeout(function(){
first = null;
},1000);
}else{
if(new Date().getTime()-first<1000){
plus.runtime.quit();
}
}

}

posted on 2019-10-12 10:55  万能的李大少  阅读(507)  评论(0编辑  收藏  举报