使用FQL
我获得了我所有朋友的ids
,names
和links to profile pictures
列表。我将此信息放在ListView
中。我使用AsyncTask
来获取图像,然后将它们插入到ImageView
中ListView
每个条目中的名称旁边。
我的问题是:我放置在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.