In Android development, there is often a need to hide the keyboard after a certain operation, so that the soft keyboard in Android is not displayed. Today, share with you how to use code to implement the hidden, displayed operation of the Android software disk.
1, method One (if the input method has been shown on the window, then hidden, and 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 forced display)
Inputmethodmanager IMM = (inputmethodmanager) getsystemservice (context.input_method_service);
Imm.showsoftinput (view,inputmethodmanager.show_forced);
3, invoke the hidden system default Input method
4, get the input method open state
Inputmethodmanager IMM = (inputmethodmanager) getsystemservice (context.input_method_service);
Boolean isopen=imm.isactive ();//isopen returns true, means the input method opens
The above is for Android to show and hide the Soft keyboard method (manual), I hope to help.