Loading different images in the listview item for custom Adapter

大兔子大兔子 提交于 2019-12-02 08:07:29

I would suggest you to try Picasso to remove the hassle of downloading images/caching etc. Once you have the jar in your workspace, all you need to do in the getView() method of the adapter class is this.

Picasso.with(context).load(result.get(IMAGE_URL)).into(holder.shared_image);

No need of the DownloadAsyncTask. As @zapl also suggested in the comment, there are other libraries like Volley and UniversalImageLoader, but I liked Picasso. You can also easily apply transformations like rounded-image using the Transformation interface provided by Picasso.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!