I needed to change the background of listview items when normal and when selected..
I used:
<ListView
android:id="@+id/resultLV"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:listSelector="@drawable/list_selector"
android:scrollbars="none" />
Where list_selector.xml is:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Selector style for listrow -->
<item android:drawable="@drawable/listoff" android:state_pressed="false"
android:state_selected="false"/>
<item android:drawable="@drawable/liston" android:state_pressed="true"/>
<item android:drawable="@drawable/listoff"/>
</selector>
The problem is, when the activity starts, the background of listview items is not changed to listoff background.. But when i select an item, it correctly changes to liston background and when released it changes to listoff background..
So my problem is at start, why it doesn't appear with listoff background drawable?
Thanks