使用 FQL
我获得了我所有 friend 的 ids
、names
和 个人资料图片链接
的列表.我将此信息放在 ListView
中。我使用 AsyncTask
获取图像,然后将它们插入 ImageView
中的每个 ListView
条目中的名称旁边。
我的问题是:我应该如何处理放置在 ImageViews
中的可绘制对象?将它们保存在内存中肯定会引发 OutOfMemory
异常,因为列表可能会变得很长。我应该将它们存储在本地缓存中吗?如果是这样,最好的方法是什么?我应该使用 SharedPreferences
因为它们更快吗?还是应该使用 SQLite
?或者……
这样做的正确方法是什么?
附言我实际上不需要代码,只需要对所有流程的解释。
最佳答案
你可能想看看UNIVERSAL IMAGE LOADER .
Universal ImageLoader for Android 的主要特点是:
• 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.
关于安卓。 Facebook SDK 好友列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18458558/