-1

I'm creating an android app.
I have a registration form in that app. Registration form is having three fields like email, password and confirm password.
I want to validate email while typing and also need to check whether password and confirm password are matching while typing. How can I do that in android?

Can anyone help me on this issue?
Your help is much appreciated.

Jainish Kapadia
  • 2,565
  • 4
  • 16
  • 29
user7160306
  • 29
  • 10

1 Answers1

0

Add textchange listener to EditText

passwordEdt.addTextChangedListener(new TextWatcher() {
  @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {

  }

  @Override public void onTextChanged(CharSequence s, int start, int before, int count) {

  }

  @Override public void afterTextChanged(Editable s) {
    String enteredText = s.toString();
    //do validation here
  }
});
arjun
  • 3,359
  • 3
  • 25
  • 46