Load image from url to Recyclerview

11.3k views Asked by At

I have an app that loads content from a database as well as images from the internet. I am using a RecyclerView along with CardView to display my content in a list form.

Each row has an image on the left side and text on the right. The problem is that the text loads fast but the image takes time to load, so I want the image to continue loading in the background and then load into the ImageView object once loading is complete. I have no idea how to tackle this.

2

There are 2 answers

0
EE66 On BEST ANSWER

I use Picasso for this situation, but u can also use Glide and many more libraries. The documentation is pretty simple.

0
elcolto On

Try Picasso:http://square.github.io/picasso/

It's a one liner in onBindViewholder(): Picasso.with(context).load(url).into(viewHolder.imageView);