I don't understand why this piece of code is not working. Only backspace and return key are detected. Listener doesn't fire for any other key. My device is Nexus One.
I tried to override activity's OnKeyDown method and that's even worse. The only detected button was hardware back button.
I am seeing around a suggestion to use TextWatcher and onTextChanged, while that might work in some cases, it's not a real work around. For example, if textbox is empty, you won't detect if user press BackSpace(Delete) button. So any ideas?
TextView txtInput = (TextView)findViewById(R.id.txtInput); txtInput.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { makeToast(keyCode + " key pressed"); return true; } });