Ext.: http://blog.csdn.net/h7870181/article/details/8332991
1, method One (if the input method is displayed on the window, then hide, or vice versa)
Inputmethodmanager IMM = (inputmethodmanager) getsystemservice (Context.input_method_service);
Imm.togglesoftinput (0, inputmethodmanager.hide_not_always);
2, Method Two (view is to accept the soft keyboard input views, show_forced means force display)
Inputmethodmanager IMM = (inputmethodmanager) getsystemservice (Context.input_method_service);
Imm.showsoftinput (view,inputmethodmanager.show_forced);
Imm.hidesoftinputfromwindow (View.getwindowtoken (), 0); Force hidden Keyboard
3, call the hidden system default Input method
((Inputmethodmanager) Getsystemservice (Context.input_method_service)). Hidesoftinputfromwindow ( WidgetSearchActivity.this.getCurrentFocus (). Getwindowtoken (), inputmethodmanager.hide_not_always); (Widgetsearchactivity is the current activity)
4, get the input method open state
Inputmethodmanager IMM = (inputmethodmanager) getsystemservice (Context.input_method_service); Boolean isOpen= Imm.isactive ();//isopen returns True indicates that the input method is open
Android manual display and hide soft keyboard