Android : How to differentaite setText and manually entered text -
i have edittext. settext() method of edittext called on button click . want identity if button click used or user manually enters location. have used textwatcher , aftertextchange() called on if user manually enters location , when settext used.
is possible identity scenenerio if editext manually edited or programatically edited.
please help.
thanking in anticipation.
you this:
private boolean istextsetprogrammatically = false; private void settextprogrammatically(string text){ myedittext.removetextchangedlistener(instanceofmytextwatcher); myedittext.settext(text); istextsetprogrammatically = true; myedittext.addtextchangedlistener(instanceofmytextwatcher) } and set textwatcher edittext , set istextsetprogrammatically false when ontextchanged() gets triggered.
Comments
Post a Comment