Load image from url to Recyclerview
Asked Answered
E

2

7

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.

Elevator answered 17/6, 2015 at 16:44 Comment(3)
developer.android.com/training/displaying-bitmaps/…Heaton
what are you using for downloading image from database?? can you post the code?Interpret
i guess here you will find detailed answer... https://mcmap.net/q/1478396/-using-parse-com-and-having-allocation-memory-issue hope it helpsInterpret
T
8

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

Traject answered 17/6, 2015 at 16:47 Comment(0)
A
6

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

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

Anecdotist answered 17/6, 2015 at 16:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.