Android Out of Memory error with Lazy Load images

后端 未结 5 1236
挽巷
挽巷 2020-12-05 22:17

I found Fedor\'s code here and implemented it into my project. The only difference is that my application does not have a list view, rather, I am accessing 1 image at a time

5条回答
  •  被撕碎了的回忆
    2020-12-05 22:32

    You should change the following line in android 2.1 or below.

    cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),"MyApp/Temp");
    

    to this

    cacheDir = new File(context.getCacheDir(), "MyApp/Temp");
    

提交回复
热议问题