I don't understand why this peace of code is not working. OnlyDelete
and Return keys 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 Delete
key.
So any ideas?

Here is my code:

        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;
                        }
        });

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to