android on Text Change Listener

You can add a check to only clear when the text in the field is not empty (i.e when the length is different than 0). field1.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) {} @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int … Read more