其他分享
首页 > 其他分享> > Android 禁用返回键

Android 禁用返回键

作者:互联网

重写dispatchKeyEvent方法即可

@Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && isTiming) {
            return true;
        }
        return super.dispatchKeyEvent(event);
    }

标签:返回,return,KeyEvent,禁用,dispatchKeyEvent,&&,Android,super,event
来源: https://www.cnblogs.com/hanayouco/p/16092750.html