What Gmail and similar apps use is the activated
state, with an appropriate row layout. See:
- Setting Android Background & Persistence Menu Bar – Using attribute on older versions causes crash – Is there a theme /pattern approach?
- Change colour of activated list item background on Honeycomb
In a nutshell, you:
- Use a row layout with an activated background (e.g.,
android.R.layout.simple_list_item_activated_1
) - Use
setChoiceMode(ListView.CHOICE_MODE_SINGLE)
on yourListView
- “Check” the row that should be activated using
setItemChecked()
on yourListView
to enable the “activated” state and have the persistent highlight