1, method One (if the input method is displayed on the window, then hide, or vice versa)
1 Inputmethodmanager imm = (Inputmethodmanager) Getsystemservice (context.input_method_service); 2 imm.togglesoftinput (0, inputmethodmanager.hide_not_always);
2, Method Two (view is to accept the soft keyboard input views, show_forced means force display)
1 Inputmethodmanager imm = (Inputmethodmanager) Getsystemservice (context.input_method_service); 2 imm.showsoftinput (view,inputmethodmanager.show_forced);
1 // Force hidden Keyboard
3, call the hidden system default Input method
1 (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
1 Inputmethodmanager imm = (Inputmethodmanager) Getsystemservice (context.input_method_service); 2 boolean isopen=imm.isactive (); // IsOpen returns True to indicate that the input method is open
"Go" Android Manually show and hide the soft keyboard