I have a listview with background image for each item.
My question is how to select multiple items in the list and how to change their background.
With this code i am able to select only 1 item at a time.
Below is my xml for the listview.

5 Answers
5

How can you select multiple items in a ListView ? We can select only one item at a time.
Its possible to check multiple items in a ListView with CHOICE_MODE_MULTIPLE, for same thing i given link to Example.

Create a boolean array having size of list.
set initial values of all the elements of array to false.
in GetView setBackground method pass background value according to value in array on that position.
setItemClickListener on list and having body arr[position]=!arr[position], and reload list by calling adapter.notifyDatasetInvalidated() method.