Wondering if anyone can assist me or just know if this can be done. I have a custom Adapter for a ListView where I have some textviews which are always present and correspond with textviews in an xml layout that is being inflated by the adapter for each row. In addition to these textviews I also need to add some textviews programatically for each row in the ListView. Each row may have a different number of textviews that need to be programatically added. When I do so, each time I scroll up and down the listview, the programatically added textviews are replicated and added to the other ones in the row, so if I scoll up and down a few times I just have a bunch of duplicate textboxes in each row. Within the getView method I have the following code to pull in the dynamic info and add the textboxes:
Set recordDeailList = item.getRecordDetailList().keySet();
Iterator<String> iterator = recordDeailList.iterator();
while (iterator.hasNext()) {
String key = iterator.next();
String value = item.getRecordDetailList().get(key);
TextView textView = new TextView(RecordsFragment.this.getActivity());
textView.setText(key + ": " + value);
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 10.5f);
);
container.addView(textView);
}
Thanks for checking this out.