Android Call Settext Within Ontextchanged
To prevent the infinite loop I did something as ugly as this... @Override protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter)
Solution 1:
You could use flags that specify if the text has been changed once or not. If it has been changed once, then do not change again, else change it.
int flag_text=0;
protected void onTextChanged(CharSequence text, int start,
int lengthBefore, int lengthAfter) {
if (flag_text==0) {
flag_text=1;
setText(tt);
}
super.onTextChanged(text, start, lengthBefore, lengthAfter);
}
Post a Comment for "Android Call Settext Within Ontextchanged"