Take a look at ListView's choiceMode. It lets you use checkboxes on list
items.

On Jul 15, 2009 8:58 AM, "Mark Murphy" <[email protected]> wrote:

Maisonobe.A (MaaKs) wrote: > here is an issue that drives me crazy : > > I
have a simple class tha...
You are not holding onto the checkbox states anywhere.

Rows in a ListView usually get recycled, meaning that when you scroll,
Android does not create a brand-new row, but rather updates an existing
row with new data. Since you are not doing anything to manage the
contents of your checkboxes, Android is ignoring them, giving you the
random checked effect you are seeing.

If you are going to put stateful widgets in list rows, like checkboxes
or RatingBar, you need to track those values and set/reset them yourself.

Here is an excerpt from _The Busy Coder's Guide to Android Development_
that covers this, though bear in mind that it uses RatingBar where you
will need to use checkboxes:

http://commonsware.com/Android/excerpt.pdf

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_
Version 0.9 Available!

--~--~---------~--~----~------------~-------~--~----~ You received this
message because you are sub...

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