Article From:https://www.cnblogs.com/ganchuanpu/p/6562075.html

Rewrite the dispatchKeyEvent method and press the return key back to execute the solution two times.

@Override  
public boolean dispatchKeyEvent(KeyEvent event) {  
        if(event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() != KeyEvent.ACTION_UP) {//Do not respond to the movement of a button//TODOSystem.out.println ("Back pressed. event.getKeyC")(ODE) (=>); "" + + event.getKeyCode () + + "," event.getKeyCode "(=>);" (+ + event.getAction)); """Return (true) / / note that when the value is true, the event will not continue to pass down, and vice versa at false. Adjust it according to the needs of the program""Return super.dispatChKeyEvent (event); }  

  

Leave a Reply

Your email address will not be published. Required fields are marked *