hi am using following xml as my customlistview background
when am click an item it will highlight but it will not persist , it create only a clickable effect ,i want to be highlight a particular item in listview when click
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<!--ON FOCUS -->
<item
android:state_focused="true"
android:state_pressed="false"
android:drawable="@@drawable/appcategoryselectedimg" />
<!--ON CLICK-->
<item
android:state_focused="true"
android:state_pressed="true"
android:drawable="@@drawable/appcategoryselectedimg" />
<!--long touch and simple touch and release-->
<item
android:state_focused="false"
android:state_pressed="true"
android:drawable="@@drawable/appcategoryselectedimg" />
<!--Default -->
<item
android:drawable="@color/transperent" />
</selector>
Because you do a simple click. What you need is to define drawable for state_selected and
setSelected(true)when the user clicks on an item.