1)在Manifest.xml文件中相應的activity下添加一下代碼:
android:windowSoftInputMode="stateHidden"
2)讓EditText失去焦點,使用EditText的clearFocus方法?
例如:EditText edit=(EditText)findViewById(R.id.edit);??????????? edit.clearFocus();?
3)強制隱藏Android輸入法窗口?
例如:EditText edit=(EditText)findViewById(R.id.edit);???????????? InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);?
?????????? imm.hideSoftInputFromWindow(edit.getWindowToken(),0);?
4).EditText始終不彈出軟件鍵盤?
例:EditText edit=(EditText)findViewById(R.id.edit);??????? edit.setInputType(InputType.TYPE_NULL);