preeti
preeti

Reputation: 1

Getting the total number of checked items from a listview in Android

How to get the total number of checked items from a listview in Android? Please help.

Upvotes: 0

Views: 540

Answers (2)

Rahul
Rahul

Reputation: 1627

or you can try a loop to check what all items are selected.

Upvotes: 0

Ben Williams
Ben Williams

Reputation: 6167

There's getCheckedItemCount(). You could also call getCheckedItemIds() on it and then call length() on that. (You can get the ListView to call this on by doing a findViewById on it, or by calling getListView() inside the ListActivity.)

Upvotes: 4

Related Questions