Skip to content

Instantly share code, notes, and snippets.

@lsurvila
Last active November 21, 2016 12:03
Show Gist options
  • Save lsurvila/f821ae4c10313599419b to your computer and use it in GitHub Desktop.
Save lsurvila/f821ae4c10313599419b to your computer and use it in GitHub Desktop.
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;
}
});
}
public interface ActionDoneListener {
void onActionDone();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment