bmalicoat wrote:
> I have a ListActivity with the ArrayAdapter whose text view resource
> ID is android.R.layout.simple_list_item_checked. This displays a nice
> list with checkmarks on each cell. I am able to get a reference to the
> CheckedTextView on a click using:
>
> protected void onListItemClick( ListView l, View v, int position, long
> id)
> {
> CheckedTextView textView = (CheckedTextView) l.getChildAt
> (position);
> textView.setChecked(!textView.isChecked());
> super.onListItemClick (l, v, position, id);
> }
>
> What I am looking to do is go through the list of cells on the launch
> of the activity and check them based on some data I have.
Use the official multiple choice framework: CHOICE_MODE_MULTIPLE and
setItemChecked() on ListView.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Android Training in NYC: 1-2 May 2010: http://guruloft.com
--
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