I have a simple ListView
and I want each of it items to be highlighted on user\'s touch. I thought this should happen by default but it isn\'t. Can you advice?
You may want to post your actual row layout code, but I suspect the problem will be that you set a background color on your list row. By default, the selectors are drawn behind the list items (which looks nicer, since the highlight color is behind the text). Either don't set a background color on your list items, or set it to draw the selector on top instead with ListView's drawSelectorOnTop XML attribute.
EDIT: If you really must have an opaque background for the default state and don't want to use drawSelectorOnTop
, you can also try this: Set a background on your list rows, but use a StateListDrawable to use @android:drawable/list_selector_background
for all but the default state (you can define an xml file in your drawables folder for this; see the StateList documentation).
You could also nest a layout inside your outer backgrounded row layout with its background set to @android:drawable/list_selector_background
; that way the background would draw on top of your background, but below the content.