Sunday 15 February 2015

java - dispatchKeyEvent calling method twice -


I have applied the sending key event in my activity to press the press key on my keyboard. The problem is that when I click, does it say my method twice? How do I fix it ? Thanks, a good day!

  @ Override Public Boolean Dispatches Event (Key Event E) {if (e.getKeyCode () == KeyEvent.KEYCODE_ENTER} {enter (); Back true; } Return super.dispatchKeyEvent (e); };    

Fixed, done this: firstly I have ACTION_DOWN But this was causing me an old problem.

  @ Override Public Boolean Dispatches Event (event event) {if (event.getKeyCode () == KeyEvent.KEYCODE_ENTER} {if (event. GetAction () == KeyEvent.ACTION_UP} {enter ( ); Back true; }} Return SuperspacePatch Event (Event); };    

No comments:

Post a Comment