I used before setListAdapter with simple_multiple_choice to make listview with checkboxes.
And then I did to get size and chosed positions:
SparseBooleanArray checked = list.getCheckedItemPositions();
cont = list.getCheckedItemPositions().size();
if (checked.get(i))
{
...
But now I needed more control on the layout, so i'm doing the listview on the xml, something like:
<listview>
<checkboxes id=.../>
</listview>
using setAdapter to those ids.
The listview is correctlyt populated (as before), problem is, now the SparseBooleanArray don't work. Thar variable 'cont', gives me 0, and 'checked' is null.
To make sure that 'list' is ok:
int len = list.getCount();
It gives me a right value.
What's the problem?