I am currently showing softkeyboard using the following code
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
im
user942821's answer for hiding it works:
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
But this also works for me to hide it:
imm.toggleSoftInput(0, 0);
You might also want to try:
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
When using '0' in the first parameter sometimes the keyboard toggles on in the wrong places under weird circumstances that I haven't been able to figure out how to duplicate yet. I'm still testing this last example, but will update when I find out more.
See toggleSoftInput documentation page for more information.