This question has already been answered:

Or how can you dynamically respond to character input in EditText?

Reported as a duplicate by participants in Yuri , Denis , Regent , ermak0ff , pavel 2 Feb '17 at 13:28 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

1 answer 1

To catch pressing Enter (or other keys, such as Search, Done, etc.):

 editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return false; } }); 

To dynamically respond to user input:

 editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void afterTextChanged(Editable editable) { //ваши действия } });