problem with Checkboxes inside ListView using BaseAdapter

by droid_gal » Sat, 02 Apr 2011 10:47:13 GMT

Sponsored Links
 Dear all,

I have a problem with my adapter that extends BaseAdapter
That is to inflate the listview's rows with a text view and a
The size of the listview is of 20 after binding and have to scroll to
see all the items.
When I checked a checkbox, says it's from the 1st row, it's also
checked the 11th checkbox automatically.
When I unchecked the 1st one, then the 11th also is unchecked.
I tried for different rows and I found out that it automatically
checks/unchecks the checkbox with difference of 10 from the checked/
unchecked one.

This is the layout xml file content for individual row:
  xmlns:android="" ;

  <TextView android:id="@+id/tvRow"

        <CheckBox android:id="@+id/chkRow"

Thanks in advance for any input to this issue.


Re: problem with Checkboxes inside ListView using BaseAdapter

by Justin Anderson » Sat, 02 Apr 2011 13:33:29 GMT

 You are suffering from a case of view recycling.  You have to keep track of
the checked views on your own and set the checked state of the checkbox in
your adapter's getView() method.

If you search Google for Android View Recycling you should be able to find
several examples of how to do this.

Justin Anderson
MagouyaWare Developer 


Sponsored Links

Re: problem with Checkboxes inside ListView using BaseAdapter

by Mary Aone » Thu, 12 May 2011 08:59:30 GMT

 @Justin Anderson: Thanks. I 'd already solved the issue and it was the same
way you mentioned.


Other Threads

1. Paging yopie ratjoen

Maaap mod numpang jalum mau pejing om yopie, tulung liatin DM yak

Sent from my BlackBerry smartphone from Sinyal Bagus XL, Nyambung Teruuusss...!

"Indonesian Android Community [id-android]" 

2. Ipv6 support - dalvik/vm/Properties.c

Hi All

In Eclair code base under dalvik/vm/Properties.c I am seeing set to true.
With this If i run CTS test cases all related to socket address and
local address are failing.

Is this means that phone is not supporting ipv6?

If i make to true all CTS cases are getting

My understanding from the above is if we want to support IPv6 then we
have to make it to true. In Donut this flag is not set and also

I am not getting in Donut code where one of these flags are set and

Please redirect me if this is not correct group to ask this question.

Gururaja B O


3. Tab reload data

4. How to check the version of my application on the android market programatically

5. Why Android is using alsa device in block mode?

6. Android:Image Not Displayed In WebView

7. Experienced Developer needed ASAP in the Paris Area