I have a ListView where each row has an EditText control. I want to add a TextChangedListener to each row; one that contains extra dat
You can remove TextWatcher from your EditText. First of all I suggest you to move TextWatcher declaration outside the the editText.addTextChangedListener(...):
protected TextWatcher yourTextWatcher = new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
// your logic here
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// your logic here
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// your logic here
}
};
After that you will be able to set TextWather little bit simpler:
editText.addTextChangedListener(yourTextWatcher);
Than you can remove TextWatcher like this:
editText.removeTextChangedListener(yourTextWatcher);
and set another if you want.