I've implemented dispatchKeyEvent in my activity to listen to the Enter key being pressed. The problem is that when i click enter,it calls my method twice ? How can i fix this ? Thanks,have a nice day !
@Override public boolean dispatchKeyEvent(KeyEvent e) { if (e.getKeyCode() == KeyEvent.KEYCODE_ENTER) { enter(); return true; } return super.dispatchKeyEvent(e); };