One: Automatically get focus when edittexit
1, get the focus does not pop-up input box, hide the soft keyboard;
2, do not let the text box to get focus;
Method One:
Add to <activity> tag: Android:windowsoftinputmode = "Statehidden"
Method Two:
In the OnCreate ()
GetWindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
Method Three:
We can preempt the focus of a text box, such as joining in its parent form:
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Xmlns:tools= "Http://schemas.android.com/tools"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Vertical"
Android:focusable= "true"
Android:focusableintouchmode= "true"
Tools:context= ". Mainactivity ">
<edittext
Android:id= "@+id/etmsg"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
/>
</LinearLayout>
Second: The default pop-up keyboard mode is the numeric keypad.
EditText et = (EditText) Findviewbyid (r.id.editnum);
Et.setinputtype (Inputtype.type_class_number);
Set the input type Type_class_number for your edittext, so that when you click EditText, the default pop-up keyboard mode is the numeric keypad.
Android Soft Keyboard issues