Share: EditText does not pop up the software keyboard by default

Method 1:
Select which activity in AndroidMainfest.xml, and set the windowSoftInputMode property to adjustUnspecified|stateHidden
For example:
<activityandroid:name=".Main"android:label="@string/app_name"android:windowSoftInputMode="adjustUnspecified|stateHidden"android :configChanges="orientation|keyboardHidden"><intent-filter><actionandroid:name="android.intent.action.MAIN"/><categoryandroid:name="android.intent.category.LAUNCHER" /> </intent- filter> </activity>

Method 2:
Let EditText lose focus, use EditText's clearFocus method
For example :
EditText edit=(EditText)findViewById(R.id.edit); edit.clearFocus();

Method 3:
Force hide Android input method window
For example :
EditTextedit=(EditText)findViewById(R.id.edit); InputMethodManagerimm= (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(edit.getWindowToken(),0);
2.EditText never pops up software keyboard
Example :
EditText edit=(EditText)findViewById(R.id.edit); edit.setInputType(InputType.TYPE_NULL);

above. In addition, I will use this for all-round online security and compatibility testing of APP: http://www.ineice.com .

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327106636&siteId=291194637