I am currently showing a soft keyboard using the following code
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput (InputMethodManager.SHOW_FORCED, InputMethodManager.RESULT_HIDDEN);
And here I do not associate a soft keyboard with Edittext, because I used the code above.
Now I want to close SoftKeyboard, so I am currently using the code below, but it does not work.
imm.toggleSoftInput (InputMethodManager.SHOW_FORCED, InputMethodManager.RESULT_HIDDEN);
Can someone suggest me what to use to close softKeyboard?
Based on the following answer, I want you to understand that I am not using EditText, I am using the layout on which I want to show the keyboard and hide the keyboard. I want to send a keyboard keyboard event to a remote bcoz area that I did not use editText.
android android-softkeyboard
Mak Jan 9 '12 at 7:12 2012-01-09 07:12
source share