Home » Android » android – How to define Textchanged event for edit text?

android – How to define Textchanged event for edit text?

Posted by: admin June 15, 2020 Leave a comment

Questions:

how to define textchanged event for EditText??

Thanks,
Balu.

How to&Answers:

You need this:

inputView.addTextChangedListener(new TextWatcher() {

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

      }

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

      }

      @Override
      public void afterTextChanged(Editable s) {

      }
    });