Thanks Doug. In my case, it was actually as simple as calling
setItemChecked(index, true) on the ListView.

On Mar 18, 10:44 am, Doug <[email protected]> wrote:
> It's customary to model the data in a data structure, then use an Adapter to
> create the individual item view that will be shown in the ListView.  If you
> need to change the data in the model, just change the model's data and tell
> the adapter that the data has changed.  That will force an update to the
> view.
>
> I'm speaking in very general terms and not addressing your specific issue,
> though I think you might benefit from this strategy.
>
> Doug
>
>
>
>
>
>
>
> On Tuesday, March 15, 2011 3:15:10 PM UTC-7, Lowell wrote:
>
> > I have an activity which contains a ListView. Each item in the list is
> > a CheckedTextView containing a checkbox. The activity can spawn a new
> > activity which can return an object to be added to the ListView. I am
> > having trouble checking that item programmatically.
>
> > I thought I could do something like:
>
> >   CheckedTextView listItem = (CheckedTextView)
> > peopleList.getChildAt(index);
> >   listItem.setChecked(true);
>
> > However, the listItem is null. I believe that this is because it
> > hasn't scrolled onto screen yet so hasn't actually been created. Might
> > that be the case? If so, how can I set its state to being checked? Is
> > there a backing model I can work with? Do I need to create a backing
> > model for all cells just to handle this case?
>
> > Thanks,
> > Lowell

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