Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
289 views
in Technique[技术] by (71.8m points)

android - How to use Universal Image Loader

I have a requirement where I need to load thumbnails and a Text in ListView which gets set by the custom Adapter. The Thumbnails should be stored in a cache memory, for that I am using the Universal Image Loader however I am pretty much confused in the implementation of it and how to use it as per my requirement in to load the images in ListView from URL. Please suggest me some ways for it with good implementation.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Write below code line into your adapter's getView() method, here imageUrls[position] is array of Image Urls and holder.image is imageview.

imageLoader.displayImage(imageUrls[position], holder.image, null);

And write below code line into your adapter constructor.

ImageLoader imageLoader=new  ImageLoader(activity.getApplicationContext());

it will solve your problem, And if you have any query regarding that then tell me.

And see below link for complete source code of Universal Image Loader Example.

Android - Universal Image Loader


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...