我有一个包含项目的列表视图。当我滚动时,图像随机出现。我不知道为什么...有适配器:
package com.forel.dbc;
[...]
public class AgendaAdapter extends BaseAdapter {
private List<Data> items; //Le contenu
private LayoutInflater inflater;
private Context context;
private SmartImageView myImage;
public AgendaAdapter(Context context, List<Data> items, DownloaderImageViewCache imageCache, boolean invertTextColor) {
this.items = items;
this.context = context;
this.imageCache = imageCache;
inflater = (LayoutInflater)this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
[...]
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = inflater.inflate(R.layout.agenda_list_item, parent, false);
}
final Data event = (Data) getItem(position);
if (event.getTitle() != null)
((TextView) convertView.findViewById(R.id.eventName)).setText(event.getTitle());
if (event.getDesc() != null)
((TextView) convertView.findViewById(R.id.desc)).setText(event.getDesc());
((SmartImageView) convertView.findViewById(R.id.my_image)).setImageUrl(event.getPicture()); // getPicture return imageUrl,
return convertView;
}}
图像随机出现在列表中
如果有人有想法...
谢谢!