Keyboard IME options Listener

 

Use following block to get trigger when user click on Softkeyboard GO, SEARCH ,SEND, DONE ime options

For those who came here from google search

Watch video 

Watch video on YouTube



edittext1.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override     public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if(actionId== [ACTION ID]){
                //perfrom your action
            }
            return false;
        }
    });

ACTION ID :


GO = 2
SEARCH = 3
SEND = 4
NEXT = 5
DONE = 6

Use corresponding id with edittext ime Options.

NOTE :

You must enable SINGLE_LINE to use this Listener.

otherwise it will not work. it will jump to next line insted