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.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I will suggest you using AQuery - (Android-Query) - a super simple UI manipulation framework for Android.
AQuery comes as a library, which you need to include in your build path.
In AQuery, you can download, display (with effects) and cache the image (both in memory and disk) with following lines:
AQuery will handle all the data downloading processes, and will display images on your ImageView you've given. Once you load the image, it will be cached in the memory (or disk) according to the boolean parameters
memCache
andfileCache
. The next time, it will load the image from the memory cache or file cache.For more information and examples, you should visit the AQuery Project at http://code.google.com/p/android-query/
More code on Image Loading - http://code.google.com/p/android-query/wiki/ImageLoading
This will Help you to load imageurl using universal imageloader it will give status for imageurl is start to Loading , Completed or failed and request is cancel status also providing.I hope it may help you..
if you like to cache the image add this below functions... But to initiate on create because its very highly ..
Then you will add that ImageLoadingListener() function...
Write below code line into your adapter's getView() method, here imageUrls[position] is array of Image Urls and holder.image is imageview.
And write below code line into your adapter constructor.
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
In your adapter's oncreate() define
and use it in the getView() method: