How to stop EditText from gaining focus when an activity starts in Android?
Adding the tags android:focusableInTouchMode=”true” and android:focusable=”true” to the parent layout (e.g. LinearLayout or ConstraintLayout) like in the following example, will fix the problem. <!– Dummy item to prevent AutoCompleteTextView from receiving focus –> <LinearLayout android:focusable=”true” android:focusableInTouchMode=”true” android:layout_width=”0px” android:layout_height=”0px”/> <!– :nextFocusUp and :nextFocusLeft have been set to the id of this component to prevent the dummy … Read more