Skip to content

Instantly share code, notes, and snippets.

public static void setActionDoneListener(EditText editText, final ActionDoneListener editTextActionDoneListener) {
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
editTextActionDoneListener.onActionDone();
return false;
}
return false;
}