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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -