1

How to change background color of list items based on their values?

view story
linux-howto

http://stackoverflow.com – I have a list of items in a database, which have values of either 0,1 or 2. I have used a simplecursor adapter and an activity which has a listview for the display. Now I want to change the background color of each item to reflect its value i.e I want the background of items with value of 0 to be green, those with value of 1 to be yellow and those with value of 2 to be red. How do i go about this? My adapter and activity are currently having black background. (HowTos)