How to use Universal Image Loader

前端 未结 5 2109

I have a requirement where I need to load thumbnails and a Text in ListView which gets set by the custom Adapter. The Thumbnails shoul

5条回答
  •  既然无缘
    2020-12-09 19:36

    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

提交回复
热议问题