问题
I'm implementing an Android gallery widget. I'm asking how to lazy (i.e. in a separate thread) load images from the web and persistently cache them? So that on the next run I have the cached images locally available...
回答1:
This is how:
Lazy load of images in ListView
Check the demo in the second answer, helped me massively!
回答2:
Try this code.the universal imageloader.
https://github.com/nostra13/Android-Universal-Image-Loader
回答3:
Try to use this tutorial Android: Help in adapting ListView adapter with an ImageLoader Class (LazyList)
Hope, it's helps you!.
回答4:
You have to use Picasso.
it's easy to use
downlod latest jar from http://square.github.io/picasso/
simply load image used below code
Picasso.with(context)
.load(url)
.placeholder(R.drawable.placeholder)
.resize(imgWidth, imgHeight)
.centerCrop()
.into(image);
来源:https://stackoverflow.com/questions/6125754/android-how-to-lazy-load-images-from-url-and-persistently-cache-them-in-gallery