无法使用Lrucache在Listview中加载图像

时间:2014-06-20 10:27:02

标签: android listview android-listview bitmap

我在listview中使用一个图像视图和2个textview并从Web服务加载图像,但是当我滚动我的listview图像时,我会使用LRUcache进行随机播放。现在使用Bitmap bitmap = mMemoryCache.get(hmList.get("StudentPhoto"))时收到错误并收到错误日志

06-20 15:54:01.995: E/AndroidRuntime(6795): FATAL EXCEPTION: main
06-20 15:54:01.995: E/AndroidRuntime(6795): java.lang.NullPointerException
06-20 15:54:01.995: E/AndroidRuntime(6795):     at **X.Y.Z.adapters.A_Adapter.getView(A_adapter.java:165)**
06-20 15:54:01.995: E/AndroidRuntime(6795):     at android.widget.AbsListView.obtainView(AbsListView.java:2207)
06-20 15:54:01.995: E/AndroidRuntime(6795):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1250)

参考资料摘自 [ListView - Images shuffle while scrolling

0 个答案:

没有答案