The solution to your problem is this:

- You must have some backing array that stores the data that you
populate the list with right? Add an "isChecked" field to each object
in that array.
- In your ListAdapter subclass where you generate the view for each
item, use that field to figure out whether checkbox in the view should
be rendered as checked.
- In onOptionsItemSelected(), if you want to check every item, go to
the *backing array*, and set the isChecked field for all items to
"true". Then call notifyDataSetChanged() on your ListAdapter.

Aaron

On Jun 2, 12:12 am, dark_messiah <[email protected]> wrote:
> @ Roman Guy
> So whats the solution for my problem...i need to select all the views
> in listview using checkbox...plz help
>
> On Jun 2, 11:57 am, Romain Guy <[email protected]> wrote:
>
>
>
> > No, the report is correct. The number of views in the ListView is
> > different from the number of items in the adapter.
>
> > On Mon, Jun 1, 2009 at 10:11 PM, dark_messiah
>
> > <[email protected]> wrote:
>
> > > No the the childcount i m getting is not correct...there are 12 views
> > > in the listview..but the count i m getting is 8...
>
> > > On Jun 2, 9:50 am, Marco Nelissen <[email protected]> wrote:
> > >> On Mon, Jun 1, 2009 at 9:27 PM, dark_messiah 
> > >> <[email protected]>wrote:
>
> > >> > I have problem...i m using a base adapter for binding a data from
> > >> > array to listview....the listview has a checkbox with it...i wanted to
> > >> > create a menu to select all or deselect all view inside that
> > >> > list...but the getchildCount method is behaving abnormally..i m not
> > >> > able to get the correct child count...can anybody help me plz......???
>
> > >> I'm pretty sure that the reported child count is correct. What value is 
> > >> it
> > >> reporting, and what value were you expecting?
>
> > --
> > Romain Guy
> > Android framework engineer
> > [email protected]
>
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support.  All such questions should be posted on
> > public forums, where I and others can see and answer them
--~--~---------~--~----~------------~-------~--~----~
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