You need to make holder.attachimage
visible in your if condition like
if(type.get(position).equals("photo"))
{
holder.attachimage.setVisibility(View.VISIBLE);// you need to make it visible here
holder.attachimage.setTag(attach.get(position));
imageLoader3.DisplayImage(attach.get(position),activity,holder.attachimage);
System.out.println("To Loader: "+attach.get(position));
}
else
{
holder.attachimage.setVisibility(View.GONE);
}
As you are using holder
suppose the view becomes invisible for a particular position. Now when you try to access that View
again it will go into the if
condition and everything will be executed but you won't be able to see it as its visibility was set to View.GONE
and it was not set back to View.VISIBLE
.