I have strange behavoir in a ViewBinder. All works good on TextViews. With CheckBoxes (removed in my code) and custom widgets progressChart the values are not stored in the right postion of the List when I scroll down and/or up again. All seems very random. But TextViews are always correct. Here is my code:
SimpleAdapter.ViewBinder viewBinder = new SimpleAdapter.ViewBinder() {
@Override
public boolean setViewValue(View view, Object data,
String textRepresentation) {
if (view.getId() == R.id.progress) {
ProgressChart progressChart = (ProgressChart) view;
progressChart.setVisibility(ImageButton.GONE);
} else {
if (x.substring(0, 1).equals("1")) {
int theProgress = Integer.parseInt(x.substring(1));
progressChart.setProgressDarkRed(theProgress);
}
}
if (view.getId() == R.id.textView1) {
TextView textView = (TextView) view;
textView.setText((String) data);
}
return true;
}
};
simpleAdapter.setViewBinder(viewBinder);
setListAdapter(simpleAdapter);
Any help is highly appreciated
I found a similar problem but the answer doesnt fit to my code. Problems with the ViewBinder