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