I have several EditText views in my activity and I do not want to have the soft keyboard appearing all the time, when a click inside an EdiText. I work with an AVD running android 2.1 and I have tested the following without success.
Inside the onCreate():
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
or
CrazyACT.this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
or
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(crazyEditText.getWindowToken(), 0);
or within the manifest file:
android:windowSoftInpu开发者_如何学运维tMode="stateHidden"
What am I missing?
Change it to "stateAlwaysHidden"
Try:
setInputType(InputType.TYPE_NULL);
精彩评论