Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ListView highlight multiple items

I want my ListView to change its background for each selected item (Multi-Selection). I used this code:

    <ListView
    ...
    android:drawSelectorOnTop="false"
    android:listSelector="@android:color/darker_gray" >

This works fine, but it is just possible to select one single item of the list. If I select another one the selection is resetted and the new one changes its background.

Is there an easy and fast way to make it possible to select more than one item at the same time with changing the background of every selected item?

like image 319
Tobias Kuess Avatar asked Nov 12 '22 19:11

Tobias Kuess


1 Answers

You can use

android:choiceMode="multipleChoice"
like image 62
LoveMeSomeFood Avatar answered Nov 15 '22 11:11

LoveMeSomeFood