android - edittext always gets back focus onFocusChange -


so code service call when edittext1 loses focus when click on edittext. focus same edittext1 everytime after service call. how can fix it. here code

edittext1.setonfocuschangelistener(new view.onfocuschangelistener() {             @override             public void onfocuschange(view v, boolean hasfocus) {                 if(!hasfocus) {                     if (edittext1.gettext().length() >= 5) {                          searchtask = new searchtask();                         searchtask.execute(edittext1.gettext().tostring());                     }                 }             }         }); 

try call edittext1.requestfocus(); after searchtask.execute(...);


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -