I am currently showing softkeyboard using the following code
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); im
I have tested and this is working:
... //to show soft keyboard imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); //to hide it, call the method again imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
By the way, the second parameter of your code is not right, please have a look at here.