Skip to content Skip to sidebar Skip to footer

Support Lib Lrucache Throws Nullpointerexception: Key == Null || Value == Null For Some Reason

I've been trying to understand how to use the LruCache to combat the problem of outOfMemory errors in the lower APIs however I've been having trouble implementing it correctly. Fo

Solution 1:

s_url is null or picture is null.

Check for null before adding to cache:

if(s_url!=null && picture!=null)
    imgCache.put(s_url, picture);
else
    Log.d(debugTag, "Put in cache failed for url:"+s_url+" and pict:"+picture);

Post a Comment for "Support Lib Lrucache Throws Nullpointerexception: Key == Null || Value == Null For Some Reason"