• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Getting checked state of ListView checkbox

  • Thread starter Thread starter Deleted User
  • Start date Start date
D

Deleted User

Guest
Hi,

I have a ListActivity and each item in the ListActivity contains a checkbox. I've extended ArrayAdapter and I have an ArrayList var which is the data associated with each item in the list. One of the pieces of data stored in this ArrayList is whether the item is checked or not. When the user checks a checkbox, I want to update the corresponding index in my ArrayList so it knows that checkbox is checked. Can someone help me out with the syntax needed for this?

Ultimately I'm enabling/disabling a menu item based on whether or not any checkboxes in the list are checked; so I'm looping through my adapter's ArrayList to check the checked state, but I need to make the check state update first.

Like I was thinking of overriding the checked handler, but how would I know which index it's at? I'm a bit confused.

Thanks
 
Are all the checkboxes their own view items, or are they grouped either together, or as part of your list?
 
Back
Top Bottom