android - EditText remove focus if setText() -
i have edittext textchangedlistener
when use myedittext.settext("") 2 things happen:
- the keyboard pops up
- 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
Post a Comment