I have a list adapter with the following view:
<?xml version="1.0" encoding="utf-8"?>
<CheckBox android:id="@+id/taskTitleCheck" xmlns:android="http://
schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:focusable="false" android:clickable="false"/>
and I want to set the checkbox to clicked or not based off the state
of a list of objects like so:
ListAdapter tempListAdapter = this.getListAdapter();
//setup the checkboxes to reflect the data
for(int idx = 0; idx < tempListAdapter.getCount(); idx++)
{
CheckBox cb = (CheckBox) tempListAdapter.getView(idx, null,
null);
cb.setChecked(m_objectList.get(idx).isChecked);
}
Setting the "setChecked()" works later on in the code, for instance in
onListItemClick I can call:
CheckBox cb = (CheckBox) l.getChildAt(position);
cb.setChecked(true);
And it works there, but It does not work onCreate or onStart. Where
can I set this data so that it shows up?
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---