Http://blog.sina.com.cn/s/blog_5edb01e90101dwh7.html
Method 1:
In androidmainfest. XML, select the activity and set the windowsoftinputmode attribute to adjustunspecified | statehidden.
< activity android:name=".Main" android:label="@string/app_name" android:windowSoftInputMode="adjustUnspecified|stateHidden" android:configChanges="orientation|keyboardHidden"> < intent-filter> < action android:name="android.intent.action.MAIN" /> < category android:name="android.intent.category.LAUNCHER" /> < /intent-filter> < /activity>
Method 2:
Defocus edittext. Use the clearfocus method of edittext.
For example:
EditText edit=(EditText)findViewById(R.id.edit); edit.clearFocus();
Method 3:
Force hide Android Input Method window
For example:
EditText edit=(EditText)findViewById(R.id.edit); InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(edit.getWindowToken(),0);
Method 4:
// The default keyboard is not displayed
getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
In the oncreate () function, add "OK.