Well, to make it simple, I have a multiselection listview and I need to know how many elements in the list I have choosen. How can I do that?

I found a solution.
getCheckedItemPositions() will create a SparceBooleanArray. So it is just to count the elements which are true in that array.

Eksample:

int counter = 0;
for(int i = 0; i < theArray.size(); i++){
   if(theListView.getCheckedItemPositions().get(i))
       counter ++;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.