Problem in listview to store images in android
I am using a listview and in the every row of that listview i am showing some images which is downloaded from URL, but the problem is that whenever i scroll up or down the images get vanished and again downloaded from the URL. How can i overcome this problem ? Can i use cache memory ? If yes, then please give me a easy sample code if possible. 开发者_开发技巧
ya you can store image in cache by using the mechanism of Lazy LIST
Although, the nature of listview is not like as you are describing. Anyhow you can store the downloaded images in an ArrayList and check before download whether the particular image exists in the ArrayList. If it is, then there is no need to redownload it. Just pick the particular image and load it into listview item.
精彩评论