使用FQL我获得了我所有朋友的idsnameslinks to profile pictures列表。我将此信息放在ListView中。我使用AsyncTask来获取图像,然后将它们插入到ImageViewListView每个条目中的名称旁边。

我的问题是:我放置在ImageViews内的可绘制对象应该怎么做?将它们保留在内存中一定会引发OutOfMemory异常,因为列表可能会很长。我应该将它们存储在本地缓存中吗?如果是这样,最好的方法是什么?我应该使用SharedPreferences是因为它们更快吗?还是应该使用SQLite?要么 ...

这样做的正确方法是什么?

附言我实际上并不需要代码,只需对所有流程进行解释即可。

最佳答案

您可能需要查看UNIVERSAL IMAGE LOADER

Android版Universal ImageLoader的主要功能是:

• asynchronous loading and displaying images from the Internet or the SD-card;
• ability of caching loaded images in memory and / or the device's file system;
• ability to monitor the loading process by means of "listeners"
• effective working with the memory while caching images in the memory;
• wide opportunities to customize the tool to fit it to your needs.

10-07 19:51
查看更多