Consider:
TextView textView = new TextView(context);
textView.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) {
s.append("A");
}
});
If we add a TextWatcher
to a TextView
, and I want to append a letter to this TextView
, every time the user writes a letter in it, but this keeps calling the TextWatcher
Listener, so on to StackOverFlow error
, so how can I append text without calling the TextWatcher
Listener again?