This is due to view recycling... You need to keep track of the checked
state of the checkboxes in a custom adapter, probably with some sort of
list of Boolean objects, and then, in the getView() method, set the state
of the checkbox based on that list.

You could also probably get some performance benefits from using the
ViewHolder pattern.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Mar 14, 2012 at 3:14 AM, Put_tiMe <[email protected]> wrote:

> I have a gridview, inside which I have a check-box and imageview and
> textview.
>
> I need to use the check box to determine whether a particular row is
> selected or not.
>
> All the other controls work as expected, except for the check-box.
> When I toggle the check box, the corresponding checkboxes in the other
> pages also get toggled.
>
> For example, I see 4 rows in one view (i.e. page).
> When I select the 1st row check box, then the 5th, 9th, 13th, 17th, etc
> rows are also selected.
>
> How can I correct this. I want each row's check box to be independent.
>
>
> The contents of the row is coming in from a XML file, and I refer like
> this:
>
>
> public View getView(*int* position, View convertView, ViewGroup parent)
> {
>       CheckBox  cbox;
>
>
>       cbox = convertView.findViewByID(R.id.checkBoxID);
>
> }
>
>
>
>
> --
> 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

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