tags:

views:

67

answers:

3

Hi all. My list view is a multiple selection list view. i have to show the selected list view items in one color(say green) and the other items in some other color(red). How to achieve this?

+1  A: 

Hi,

It depends what you mean by showing "items in [...] color." The easiest way to change items' colors is to do it in the Adapter's getView() or bindView() method.

Romain Guy
A: 

In the onItemSelectListner change the item background to whichever you need.

Karan
THe problem with this (and Rowno's similar comment) is that you need to keep track of this state for example when you rotate the screen. Better to store it as a property in the underlying data set and render the list item appropriately, as Romain Guy mentions.
Christopher
As far as I understand, you want the user to select multiple items and change its color. And I think doing this in the getView() and bindView() won't fully solve your problem. These methods are called when the view gets added to the view.
Karan
A: 

You could call the setBackgroundColor() method in the select event to change the background color.

Rowno