android - Ignore backspace in EditText -


i have edittext need ignore backspace keyevents. have following class, doesn't work:

public class customedittext extends edittext    {      public customedittext(context context, attributeset attrs) {         super(context);         // todo auto-generated constructor stub         this.setonkeylistener(new onkeylistener() {                              @override             public boolean onkey(view v, int keycode, keyevent event) {                 //you can identify key pressed buy checking keycode value keyevent.keycode_                 if(keycode == keyevent.keycode_del){                       //do nothing                 }                 return true;             }         });     } } 

try overriding onkeydown method instead of adding listener


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -