cocos构建的android项目的返回键相应

 

  @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        //返回键  cocosActivity不相应onbackPressed和onKeyDown
        if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){
            LogUtils.i("dispatchKeyEvent");
            getMainState();
        }
        return super.dispatchKeyEvent(event);
    }

 

cocos构建的android项目的返回键相应

上一篇:通俗易懂讲解happens-before原则


下一篇:Edge-assisted Tra?ic Engineering and applications in the IoT