I've got a (hopefully) simple question. My program has a ListView
to display some data. When an item is pressed, I call the setChecked
method on it to mark it as checked. How do I have this "checked" item appear highlighted or in a different style? I was doing some reading on this and found a lot of things that had to do with check-boxes, but I just want to highlight an item that is "selected" by tapping it.
EDIT: I do have a selector setup as follows:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/category_tab_s" android:state_checked="true"/>
<item android:drawable="@drawable/category_tab"/>
</selector>
However, it never applies the checked state. When I press items the category_tab
state is activated.