I use Glide library inner custom adapter view in my apps. But I have Error :
"You must not call setTag() on a view Glide is targeting"
This part of my code :
@Override
public View getView(int position, View view, ViewGroup container) {
ViewHolder holder;
if (view == null) {
holder = new ViewHolder();
view = holder.imageView = new ImageView(context);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
holder.imageView.setAdjustViewBounds(true);
LinearLayout.LayoutParams vp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
holder.imageView .setLayoutParams(vp);
holder.imageView .setScaleType(ImageView.ScaleType.CENTER_CROP);
String var_news_article_images = imageIdList.get(getPosition(position));
Glide.with(context)
.load(var_news_article_images)
.placeholder(R.drawable.placeholder)
.into(holder.imageView);
return view;
}
so how to fix it ?