AutoCompleteTextView always keeps focus

android, focus, user-interface

Solution

Only solution that worked for me is to add this line

android:focusable="true" 
android:focusableInTouchMode="true"

To parent of AutoCompleteTextView (like LinearLayout etc..)

Problem

I have `2 AutoCompleteTextViews` in an activity (LinearLayout) and several `additional controls` (radiogroups, buttons, etc). Somehow the AutoCompleteTextViews are `never losing focus`. As Example: The user clicks on an AutoCompleteTextView, the control gets the focus. So the cursor starts blinking, the autocomplete dropdown list and the keyboard is shown. This is fine. However if the `user now clicks on of the radio buttons` (or another control), the cursor in the AutoCompleteTextView `is still blinking` and the keyboard is still shown. How to make the focus disappear automatically? EDIT: xml code ``` <AutoCompleteTextView android:id="@+id/ediFrom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:singleLine="true" android:text="" /> ```

Original source