I am working on an app where I need to open my own custom soft keyboard for text input.To do that I am disabling the default soft keyboard and enabling the custom one. It works fine on Jelly Bean version. However when I run the same code on Nexus 7 Tab Kitkat version it does not hide the default soft keyboard. I am using the following code for hiding the default soft Keyboard:Any idea it his not working on Kit Kat version on Nexus 7 tab?? I have researched a lot but I have not been able to figure it out.
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Thanks in advance
You can try the following:
public void hideKeyboard(Activity context, View v) {
InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), 0);
}