I have a KeyListener on an editText like so:
tip = (EditText) findViewById(R.id.tip);
tip.setOnKeyListener(new EditText.OnKeyListener(){
public boolean onKey(View v, int keyCode, KeyEvent event) {
Log.i("debug123", "onKeyListener. event.getKeyCode(): " + event.getKeyCode());
// If the event is a key-down event on the "enter" button
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
checkInput();
return true;
}
return false;
}
});
But no softkeyboard-stroke is recognised.? Only when I left the Activity with the BACK-Button (HardwareButton) the Listener recognises the action. But from all that I read, this is the way to go if I want to work with user-input at a EditText.