apicloud keyback 事件 退出app事件 再点一次退出app事件
//退出APP function exitNowApp(){ $api.setStorage('isFullScreen',0); //按两次退出应用 api.addEventListener({ name : 'keyback' }, function(ret, err) { //全屏时 需要发送事件 并关闭全屏 var isFullScreen = $api.getStorage('isFullScreen'); console.log("isFullScreen"+isFullScreen); //如果全屏 只关闭全屏 if(isFullScreen == '1'){ api.sendEvent({ name: 'clickhome', extra: {} }); }else{ api.toast({ msg : '再点一次退出应用', duration : 2000, location : 'bottom' }); api.addEventListener({ name : 'keyback' }, function(ret, err) { if($api.getStorage('isFullScreen' == "0")){ api.sendEvent({ name: 'clickhome', extra: {} }); }else{ api.closeWidget({