keyevent - android SEND key crashes -


i have need check enter key start search routine. works except keyboards seem have send button instead of enter button. when pressed code dumps. have small sample below. ideas?

tx1.setoneditoractionlistener (new oneditoractionlistener() {     @override     public boolean oneditoraction(textview v, int actionid, keyevent event) {         system.out.println("key: " + event.getkeycode()); //blows here         if  (event.getaction() ==  keyevent.action_down) {             if (event.getkeycode() == keyevent.keycode_enter) {                 // ...             }         }     } } 

i believe event null in case. detecting send action on softkeyboard oneditoractionlistener should this.

oneditoraction(textview v, int actionid, keyevent event){     if(actionid == editorinfo.ime_action_send){         send();     }     return false;// softkeyboard still close after pressing 'send' } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -