android - Stop EditText from gaining focus at Activity startup -


i have android activity, 2 elements:

  1. edittext
  2. listview

when activity starts, edittext has input focus (flashing cursor). don't want control have input focus @ startup. tried:

edittext.setselected(false); 

no luck. how can convince edittext not select when activity starts?

excellent answers luc , mark code sample missing:

<!-- dummy item prevent autocompletetextview receiving focus --> <linearlayout     android:focusable="true"      android:focusableintouchmode="true"     android:layout_width="0px"      android:layout_height="0px"/>  <!-- :nextfocusup , :nextfocusleft have been set id of component prevent dummy receiving focus again --> <autocompletetextview android:id="@+id/autotext"     android:layout_width="fill_parent"      android:layout_height="wrap_content"     android:nextfocusup="@id/autotext"      android:nextfocusleft="@id/autotext"/> 

Comments