这是我的代码。
if (view == null) {
view = lInflater.inflate(
R.layout.list_item_multiple_choice, null);
vHolderMultiple = new ViewHolder();
vHolderMultiple.tv = (TextView) view.findViewById(R.id.tvMultipleChoiceListItem);
vHolderMultiple.cb = (CheckBox) view.findViewById(R.id.cbMultipleListItem);
vHolderMultiple.iv = (ImageView) view.findViewById(R.id.ivMultiChoiceItem);
view.setTag(vHolderMultiple);
}
else {
vHolderMultiple = (ViewHolder) view.getTag();
}
vHolderMultiple.tv.setText(optionArray.get(position).getOptionText());
vHolderMultiple.cb.setChecked(lvAnswers.isItemChecked(position));
if (optionArrayCopy.get(position).getImageUrl() != null && optionArrayCopy.get(position).getImageUrl().length() > 0) {
final Bitmap bmp = loader.loadImageBitmap(optionArray.get(position).getImageUrl(), resDir);
vHolderMultiple.iv.setVisibility(VISIBLE);
if (bmp != null) {
vHolderMultiple.iv.setImageBitmap(bmp);
}
} else
vHolderMultiple.iv.setImageBitmap(null);