How to get selected list items from a Listview with checkBox and Custom Adapter?

adapter, android, checkbox, listview

Solution

In the customadapter's getview method, do

//use the actual id of your checkbox of course
Checkbox checkbox = (CheckBox)findViewById(R.id.checkbox); 
checkbox.setFocusable(false);
checkbox.setFocusableInTouchMode(false);

now the checkbox is clickable as is the listitem.

Problem

I have a `ListView` with `CheckBox` on it. and i am using `Custom Adapter` to populate the `ListView`. In my `xml` file i have a `Button` at bottom. what i want is let user select number of rows in `ListView` and when he/she clicked on the `Button` get the position of the selected items so that i could get the object for particular row for further calculations.

Original source

Related problems