【发布时间】:2015-01-21 00:52:46
【问题描述】:
我有包含图片的 recyclerview。
@Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
// Get element from your dataset at this position and replace the contents of the view
// with that element
if(mEntities.get(position).url.equals("kosong")) {
Log.e("LOAD", "KOSONG " + position);
viewHolder.getTextDataView().setText(mEntities.get(position).data);
}
else{
Log.e("LOAD", "ISI " + position);
Picasso.with(mContext).load(mEntities.get(position).url).skipMemoryCache().into(viewHolder.imageView);
viewHolder.getTextDataView().setText(mEntities.get(position).data);
}
}
我成功地将图像加载到正确列表中的 recyclerview,但不知何故它在该 recyclerview 的另一个列表中重复。为什么?
感谢您的回答:)
【问题讨论】:
-
我确保之前没有错误的 if else 条件,但不知何故它仍然在随机列表中复制图像。
标签: java android android-studio picasso