Reputation: 623
I got stuck upon one of the Picasso so-called open fun methods.
I am using URL in my recyclerview to get images. I don't think it is the problem with recyclerview. I think its more likely a bug.
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
Picasso.get().load(arrayPlaces[position].url).into(holder.itemView.findViewById(R.id.mainImage))
}
For Solution I tried:
GitHub : https://github.com/sophin123/RecyclerViewwithImages
Upvotes: 0
Views: 402
Reputation: 623
Solved it by adding ImageView in findViewById<>()
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
Picasso.get().load(arrayPlaces[position].url).into(holder.itemView.findViewById<ImageView>(R.id.mainImage))
}
Upvotes: 0