android - Listview default item selected -


i have listview show below:

    <listview         android:id="@+id/left_drawer"         android:layout_width="240dp"         android:layout_height="match_parent"         android:layout_below="@id/profile_picture"         android:layout_gravity="start"         android:layout_margintop="30dp"         android:background="#f7f7f7"         android:choicemode="singlechoice"         android:divider="@android:color/transparent"         android:dividerheight="0dp"         android:entries="@array/navigation_drawer"         android:listselector="@color/navigation_selector"         android:paddingleft="20dp"/> 

and want make first item in list selected, have tried list.setselection(0), setitemchecked none of them works.

looks need state- aware backgrounds on list items described in of answers here:

listview item selection android


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -