1. Open the input method window:
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE );
// Accept the edited text or other views input by the soft keyboard
Imm. showSoftInput (submitBt, InputMethodManager. SHOW_FORCED );
Ii. Close the entry/exit window
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE );
InputMethodManager. hideSoftInputFromWindow (OpeListActivity. this. getCurrentFocus (). getWindowToken ()
, InputMethodManager. HIDE_NOT_ALWAYS );
// Accept the edited text or other views input by the soft keyboard
InputMethodManager. showSoftInput (submitBt, InputMethodManager. SHOW_FORCED );
3. If the input method is enabled, the function is disabled. If the input method is not enabled, the function is enabled.
InputMethodManager m = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE );
M. toggleSoftInput (0, InputMethodManager. HIDE_NOT_ALWAYS );
4. obtain the status of the input method.
InputMethodManager imm = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE );
Boolean isOpen = imm. isActive ();
If isOpen returns true, it indicates that the input method is enabled.