views:

364

answers:

1

I am displaying a radio schedule in a List View and would like to highlight the currently playing program. I also want to allow the user to click on any program and get more details for the program. I have tried the following:

radioView.setSelection(adapter.getCurrentProgramIndex());
radioView.setSelected(true);

This does scroll the list down to the selection which is good, but it does not highlight the selection. I understand this is because the device is not in touch mode, but how then would I go about highlighting the current program?

+1  A: 

how then would I go about highlighting the current program?

Change something in that list row. For example, perhaps you have an icon you can switch to be a "playing" icon, or have an icon that is formerly INVISIBLE become VISIBLE, or something.

Bear in mind that you will need to have these smarts in your row binding code, so that if the user scrolls, you correct undo and redo that setting -- otherwise, row recycling will make it appear that other programs are playing.

CommonsWare
Can I also change the background color?
Jay Askren
Yes, but that gets tricky, so it does not interfere with the selector bar.
CommonsWare
The icon idea works quite well. Thank you.
Jay Askren