I'm developing an Android app which needs to display the phone's images onto a GridView. What I need to do is to load those images asynchronously, and don't have the user to wait until all the photos have been loaded. What's the best way to do this, by using a CursorLoader or an AsyncTaskLoader maybe?
Thanks in advance.
I highly recommend you Picasso
: http://square.github.io/picasso/
It's a perfect library to load images with asynchronous thread.
You can load your image in your adapter with:
Picasso.with(yourContext).load("http://yoururl.com/yourimage.png").into(yourImageView);
After trying to implement this on my own and coming across all kinds of problem which have already been solved by others i went on using Picasso.
You load images in 1 line of code:
Picasso.with(context).load(imageUrl).into(imageView_XY);
http://square.github.io/picasso/
Alternative:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.