Cursoradapter Autoupdates Images
I have a customized SimpleCursorAdapter that gets information from a database. If one value is 1 I color the background of an ImageView, if it's 0 I don't color it. When the ListVi
Solution 1:
You'll want to make your ViewHolder class static and create a static int array inside that view holder class. In the getView you should set that array with your value from the database and also use that array to set the row like you want it.
This is how I managed to keep checkboxes correct in an ExpandableListView:
staticclassViewHolder{
CheckBox check;
staticboolean[][] bool = newboolean[parentCounter][childCounter];
publicstaticvoid setChecked(intparent, int child, boolean value) {
bool[parent][child] = value;
}
publicstaticboolean getChecked(intparent, int child) {
returnbool[parent][child];
}
}
It's the same concept.
Post a Comment for "Cursoradapter Autoupdates Images"