To prevent the infinite loop I did something as ugly as this...
@Override
protected void onTextChanged(CharSequence text, int start,
int lengthBefore, int lengthAfter) {
String t = text.toString();
String tt = t.toUpperCase();
if (!t.equals(tt)) {
setText(tt);
}
super.onTextChanged(text, start, lengthBefore, lengthAfter);
}
Is there any other way to prevent the onTextChanged
from being called when changing the text within onTextChanged
?