This problem is stackoverflow above a hot issue with Stop EditText from gaining focus at Activity startup. Now I will translate this question and collate the answers to ensure that this problem can be solved.
The author encounters the following problems:
I have an activity with a edittext and a ListView, and whenever I start the activity, EditText automatically gets the focus (where the cursor flashes). And I don't want him to get the focus, I tried the following statement
EditText.setSelected(false);
But it doesn't work at all, how should I stop edittext from getting the focus?
Summary of the answer:
Answer 1: Make sure your XML layout file does not have a requestfocus tag, which will be automatically added by Eclipse, and if so, delete it.
Answer 2: Add two rows to the parent layout where EditText is located
<LinearLayout android:focusable="true" android:focusableInTouchMode="true"/>
This way the parent layout gets the focus by default, and the focus is snatched from the edittext.
Answer 3: No answer 3, the above two answers basically can solve the problem.
Prevent EditText from automatically gaining focus after Android starts activity