Today, I sorted out the operations on the input method in Android:
1. Open the input method window:
Copy codeThe Code is as follows: 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
Copy codeThe Code is as follows: nputMethodManager inputMethodManager = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE );
InputMethodManager. hideSoftInputFromWindow (OpeListActivity. this. getCurrentFocus (). getWindowToken (),
InputMethodManager. HIDE_NOT_ALWAYS );
<DIV style = "LINE-HEIGHT: 26px; FONT-FAMILY: Arial; COLOR: rgb (51,51, 51 );
FONT-SIZE: 14px "id = _ mcePaste> // accept the edited text or other views entered by the soft keyboard. </DIV>
<P style = "LINE-HEIGHT: 26px; FONT-FAMILY: Arial; COLOR: rgb (51,51, 51); FONT-SIZE: 14px"> inputMethodManager </P>
<DIV style = "LINE-HEIGHT: 26px; FONT-FAMILY: Arial; COLOR: rgb (51,51, 51); FONT-SIZE: 14px" id = _ mcePaste>. showSoftInput (submitBt, InputMethodManager. SHOW_FORCED); </DIV>
3. If the input method is enabled, the function is disabled. If the input method is not enabled, the function is enabled. Copy codeThe Code is as follows: InputMethodManager m = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE );
M. toggleSoftInput (0, InputMethodManager. HIDE_NOT_ALWAYS );
4. obtain the status of the input method. Copy codeThe Code is as follows: InputMethodManager imm = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE );
Boolean isOpen = imm. isActive ();
// If isOpen returns true, it indicates that the input method is enabled.