android - EditText remove focus if setText() -


i have edittext textchangedlistener

when use myedittext.settext("") 2 things happen:

  1. the keyboard pops up
  2. the texchangedlistener (textwatcher) fired.

i want know if there way of removing related events when use settext()

the first problem i've solved with

if (getwindow() != null) {        getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_hidden); }  

just before myedittext.settext("") still think should way of disabling events firing in specific situations.

any idea 2 point or how should handle events?

set edittext change listener null, set text empty string, , set change listener again.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -