diskcache

How can I use both DiskLruCache(DiskCache) and LruCache(MemoryCache)?

左心房为你撑大大i 提交于 2019-12-10 11:59:35
问题 I'm developing Image Loader using both cache. and here is my logic. 1st, start get the images on the disk cache (when app starting) 2nd, check the memory cache. if it is, load from Cache memory. 3nd, If the image doesn't exist in memory cache, check the Disk cache. then put the image into the memorycache. 4th, If there isn't the image both memory cache and disk cache, make the bitmap from url using the asynctask. then put the Disk cache. and This is my source. 1st, App's onCreate() protected

Volley out of memory error, weird allocation attempt

别来无恙 提交于 2019-11-26 22:16:45
Sometimes randomly Volley crashes my app upon startup, it crashes in the application class and a user would not be able to open the app again until they go into settings and clear app data java.lang.OutOfMemoryError at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:316) at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:526) at com.android.volley.toolbox.DiskBasedCache.readStringStringMap(DiskBasedCache.java:549) at com.android.volley.toolbox.DiskBasedCache$CacheHeader.readHeader(DiskBasedCache.java:392) at com.android.volley.toolbox

Volley out of memory error, weird allocation attempt

☆樱花仙子☆ 提交于 2019-11-26 08:14:55
问题 Sometimes randomly Volley crashes my app upon startup, it crashes in the application class and a user would not be able to open the app again until they go into settings and clear app data java.lang.OutOfMemoryError at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:316) at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:526) at com.android.volley.toolbox.DiskBasedCache.readStringStringMap(DiskBasedCache.java:549) at com.android.volley