Android makes EditText out of focus to avoid automatically pop-up input methods. androidedittext
If you enter the activity, EditText gets the focus, and the input method interface pops up, which will undoubtedly affect the appearance. For more information about how to make EditText lose focus, you can add a Textview with visibility = gone on the Internet. Then, let the textView get focus. I don't know whether my character is bad or not. I can't do this. I used another method later, that is, to add the following two codes to the parent component (layout:
android:focusable="true" android:focusableInTouchMode="true"
For example:
<RelativeLayout android: layout_width = "match_parent" android: layout_height = "40dp" android: gravity = "center_vertical" android: background = "# ffffff" android: focusable = "true" android: focusableInTouchMode = "true"> <EditText android: layout_alignParentLeft = "true" android: id = "@ + id/searchWordET" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: background = "# ffffff" android: hint = "name unit name QQ mobile phone address" android: padding = "10dp" android: imeOptions = "actionSearch" android: singleLine = "true" android: textSize = "13sp"/> </RelativeLayout>
Perfect solution!
EditText automatically obtains the focus, but does not bring up the Input Soft Keyboard ???
InputMethodManager im = (InputMethodManager) getSystemService (INPUT_METHOD_SERVICE); im. showSoftInput (TV, 0 );
Why does the input method not automatically pop up after EditText gets the focus?
Input Method? Web Input Method? Or system input method