henri51
henri51

Reputation:

Android - selected item position in a listview

How can I retrieve the positions of the selected item in a multichoice listView? The getSelectedItemPosition method returns only the first one.

Upvotes: 1

Views: 5714

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006819

There is at most one selected item in a ListView.

If your ListView is CHOICE_MODE_SINGLE or CHOICE_MODE_MULTIPLE, you can use getCheckedItemPositions() to get the checked ones.

Upvotes: 10

Related Questions