Some images are not loading because the URL is empty or does not contain "http".
The reason why you see empty cells becoming non-empty is that views are recycled. So you need to either call Picasso or set the default image for your ImageView
manually in getView()
, but you can never leave the ImageView
untouched.
Because you only call Picasso conditionnaly without always clearing the image, then when the URL is empty or does not contain "http", your ImageView
will still contain the previous image of the recycled cell.
So change your code like this:
if ((item.getPicture() != null) && item.getPicture().contains("http")) {
Picasso.with(context).load(item.getPicture()).placeholder(R.drawable.default_picture).into(holder.imageView);
} else {
holder.imageview.setImageResource(R.drawable.default_picture);
}