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);
2, Method Two (view is to accept the soft keyboard input views, show_forced means force display)
Inputmethodmanager IMM =
Imm.showsoftinput (view,inputmethodmanager.show_forced); // 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 to indicate that the input method is open
Android manual display and hide soft keyboard