Today I have sorted out the operation of the input method under Android: the specific one is as follows
1. Open the input method window:
Copy the codeThe code is as follows:
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
// Accept edited text or other views input from soft keyboard
(submitBt,InputMethodManager.SHOW_FORCED);
2. Close the entry and exit window
Copy the codeThe code is as follows:
nputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
(().getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
<DIV style="LINE-HEIGHT: 26px; FONT-FAMILY: Arial; COLOR: rgb(51,51,51);
FONT-SIZE: 14px" id=_mcePaste>//Accept edited text or other views input from 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 turned on, close, if it is not turned on
Copy the codeThe code is as follows:
InputMethodManager m=(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
(0, InputMethodManager.HIDE_NOT_ALWAYS);
4. Get the status of the input method open
Copy the codeThe code is as follows:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
boolean isOpen=();
// If isOpen returns true, it means that the input method is open