At some point, you need to force the hidden Android keyboard, such as the current keyboard is showing, this time click on the slide-side panel, you must force the hidden input keyboard. Common methods on the Internet are:
1,inputmethodmanager imm = (Inputmethodmanager) getactivity ()
. Getsystemservice (Context.input_method_service);
Imm.togglesoftinput (0, inputmethodmanager.hide_not_always);
This is to let the input method status reversal, if not currently displayed is displayed. If it is displayed, it is hidden. Therefore, it does not conform to the application scenario described in this article.
2, Imm.hidesoftinputfrominputmethod (Passwdedit.getwindowtoken (), 0);
This by myself on the android4.2 machine test invalid.
3, Imm.hidesoftinputfrominputmethod (Getactivity (). Getcurrentfocus (). Getwindowtoken (), 0);
After I test, still invalid. Uncle's, for this small function wasted Zajia two hours of time.
4,Imm.hidesoftinputfromwindow (Passwdedit.getwindowtoken (), 0);
After testing, this is the only effective method!
In addition, it was said that:
Inputmethodmanager IMM = (Inputmethodmanager) This
. Getsystemservice (Context.input_method_service);
Boolean isopen=imm.isactive ();
LOG.I (TAG, "imm.isactive () =" + IsOpen);
Use the above code to determine whether the current input keyboard pop-up visible, completely rip, IsOpen has been true. Hereby record.
Android hidden input keyboard (Hidesoftinputfrominputmethod no effect)