I implemented dispatchKeyEvent in my activity to listen for the Enter key press. The problem is that when I press the enter button, it calls my method twice? How can i fix this? Thank you, had a good day!
@Override public boolean dispatchKeyEvent(KeyEvent e) { if (e.getKeyCode() == KeyEvent.KEYCODE_ENTER) { enter(); return true; } return super.dispatchKeyEvent(e); };
Sorin grecu
source share