2
votes

I have inherited EditText class an made my custom class, MyEditText.

and want to detect key pressed(say 'a', 'b', 'c'... '0', '1', '2'... etc.) event in Android. How?

It seems overridden method onKeyDown(int keyCode, KeyEvent event) is called when 'back', '\', '/', 'DEL', '@' keys are pressed, but not for any numeric or alphabets.

1

1 Answers

2
votes

Maybe what you need is not a keypress event, but a text change event. Then you can use addTextChangedListener method.