How to stop the android soft keyboard from ever coming up in my entire application
Posted
by JohnnyLambada
on Stack Overflow
See other posts from Stack Overflow
or by JohnnyLambada
Published on 2010-03-12T00:06:01Z
Indexed on
2010/03/12
0:47 UTC
Read the original article
Hit count: 495
android
|android-hardware
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.
© Stack Overflow or respective owner