I have an EditText that I want to track KeyEvents, and I have a listener configured as follows:
mText = (EditText) this.findViewById(R.id.title); mText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { final int view = v.getId(); switch (view) { case R.id.title: Log.d(LOG_TAG, "key handled"); break; } return false; } });
My problem is that when an EditText is entered into the virtual keyboard, the only keystroke that starts logging is the back key. I checked that all other keystrokes do not even start onKey() . I'm sure this is something simple, but nothing was found on SO, which seems to be able to handle this.
Thanks,
Floor
Paul mennega
source share