How to stop the android soft keyboard from ever coming up in my entire application
- by JohnnyLambada
I'm developing an application on a hardware device that has a built-in hardware keyboard that does not slide out so is always visible (like a blackberry). Therefore, I NEVER want the soft keyboard to display for my entire application. I'm aware of another SO question that gives the following lines of code:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
But I don't know where to put this code to hide the soft keyboard in all places where it might possibly appear in my Activity. I have tried adding the code to Activity.onUserInteraction to no avail. It seems the keyboard appears after the onUserInteraction executes.