android - Handling Back button when keyboard is up -


in application have edittext. when focus element, cursor appears , keyboard shows up. when know press button, keyboard disappears element stays focused , blinking cursor still visible.

i tried manage code found on other posts, doesnt work, dont event.

public boolean dispatchkeyeventpreime(keyevent event) {          if(event.getkeycode() == keyevent.keycode_back) {         toast.maketext(this, "keyevent abgefangen", toast.length_long).show();         search.clearfocus();         inputmethodmanager imm = (inputmethodmanager) getsystemservice(context.input_method_service);         imm.hidesoftinputfromwindow(search.getwindowtoken(), 0);     }     return true;         } 

tried calling requestfocus() in element?

like example if have textedit or that


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -