开发者

Android: How to make soft keyboard not appear at all

开发者 https://www.devze.com 2023-03-22 20:46 出处:网络
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 teste

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消