fuadj fuadj - 3 months ago 10x
Android Question

EditText valid input indicator

I have a validation for an editText where a user inputs an id. The id has a minimum length of 6 and has error detection. I want to inform the user when a correct id is entered right away. I've searched online and most of what i've found is the case of telling the user of invalid input through methods like

. So my question is, is there a
equivalent for when the user has done the correct thing.


You can use the TextChangeListener to perform events when the user changes the text.

textEdit.addTextChangedListener(new TextWatcher() {

   public void afterTextChanged(Editable s) {}

   public void beforeTextChanged(CharSequence s, int start,
     int count, int after) {

   public void onTextChanged(CharSequence s, int start,
     int before, int count) {
      // validate text and inform user