I have a listview that when scrolled and the items go off of the screen they are not redrawn when I scroll back to them (the text and checkbox). In fact, items that are off the bottom of the screen in the listview never get drawn when scrolling to them. This only happens in Froyo. Any other version it works just fine. I have checked and the data is there as expected in the adapter when the getItem method is called, it is just not visible. The listview item is there (it's occupying the same amount of screen space per item), I just cannot see the text or checkbox once scrolled off screen and back on again.
My code is such:
for (checklist cl : checkLists) {
ArrayList<checklistItem> ChecklistItems = database.getChecklistItems(cl.getId());
ListView lv = new ListView(this);
lv.setScrollingCacheEnabled(true);
lv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
la = new checklistItemAdapter(this, layoutItem, ChecklistItems);
la.setActivity(this);
lv.setAdapter(la);
TextView tv = new TextView(this);
tv.setText(cl.getItemText());
tv.setGravity(1);
tv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 50));
tv.setBackgroundColor(Color.BLUE);
tv.setTextSize(28);
tv.setTextScaleX(2);
tv.setTypeface(Typeface.DEFAULT_BOLD);
tv.setTypeface(Typeface.SANS_SERIF);
layoutChecklist = new LinearLayout(this);
layoutChecklist.setOrientation(1);
layoutChecklist.addView(tv);
layoutChecklist.addView(lv);
layoutChecklists.addView(layoutChecklist);
}