f 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.

-- 
Sincerely,
Liang

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to