Khawar Raza Khawar Raza - 2 years ago 63
Android Question

android: Softkeyboard perform action when Done key is pressed

I have an EditText. I want that after typing some text, when user presses the Done key of softkeybard, it should perform some search operation which I have also implemented in a button click event. How to do that...???

Answer Source

Try this

editText.setOnEditorActionListener(new OnEditorActionListener() {        
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            //do something
    return false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download