Double-click the back button to exit the application AppCan

Use AppCan develop mobile applications, double-click operation to achieve interception return key to exit the application within two seconds Custom

var c1c = 0;
window.uexOnload = function(type){
    uexWindow.setReportKey(0,1);
    uexWindow.onKeyPressed = function(){ 
        if (c1c > 0) {
            uexWidgetOne.exit();
        }
        else {
            uexWindow.toast(0, 5, '再按一次退出应用', 1000); 
            c1c=1; setTimeout(function(){ c1c=0; }, 2000);
        }
    };
}

Unfortunately, the current version does not support drop is a direct exit the application, have to pop a message box to determine, replied may be updated in version 2.5


=====================================================

A year ago wrote the article, in fact, already completely abandoned appcan, and it is a relatively poor performance experience, but is said to be better than phoneGap, but not open source, there seems to be no way to maintain, or the only Native Development

Reproduced in: https: //my.oschina.net/zhouz/blog/213179

Guess you like

Origin blog.csdn.net/weixin_34388207/article/details/91728507