Android ListView
if my list has 10 items.. the onclick listener is fired only for the 10th item. How to get the state of checkbox in a onListItemClick in Listactivity?
I have a class OnItemClickListener like this:
private class OnItemClickListener implements OnClickListener {
private int mPosition;
public OnItemClickListener(int position) {
mPosition = position;
}
@Override
public void onClick(View arg0) {
if (arg0 == repeat_chbt) {//check box is checked
A
} else {//item is checked
B
}
}
}
and I use this class like this in my getview()
repeat_chbt.setOnClickListener(new OnItemClickListener(position));
but only when I check the last item's checkbox, it go A correctly. Other items' checkbox are checked they just go B. Who could tell me where I am wrong. Thanks very much. I've searched many site, but I didn't find out the answer.