Android LRU cache not caching on gingerbread -


I have used the LRU cache for caching bitmap images. I used them to implement them, and this ice cream Works fine on sandwiches.

However, the caching process does not work on gingerbread.

Here is my code:

  import android.support.v4.util.LruCache; (...) Public square thumbnaildownloader & lt; Token & gt; HandlerThread Extended {(...) Private Static Last String TAG = "ThumbnailDownloader"; Private Lucrash & lt; String, bitmap & gt; MMemoryCache; (...) Public Zero AddBitmapToMemoryCache (String Key, Bitmap Bitmap) {If (GetBitmapFromMemCache == Faucet) {Log.i (Tag, "(First) Cache Size:" + ((Integer) mMemoryCache.size ( )).Wire()); Mememorycache.put (key, bitmap); Log.i (tag, "(after) cache size:" + ((integer) mMemoryCache.size ()). ToString ()); Bitmap cached = ammo cache.gate (key); If (cached == empty) {Log.i (TAG, "Cache to fail!"); } Else {Log.i (tag, "cached item:" + (string) cached.toString ()); This code works fine on ice cream sandwiches, for example, when the first caching is done, the output is:  
 < Code> 02-18 10: 59: 42.505: I / Thumbnail Downloader (2691): (First) Size of the cache: 0 02-18 10: 59: 42.505: I / Thumbnail Dllder (2691): Cache Size: 77 02-18 10: 59: 42.505: I / Thumbnail Droploader (2691): Cached Items: android.graphics.bitmap@4298cc38  

However, the result of Gingerbread was different : (The caching size was not changed)

  02-18 10: 59: 03.20 9: i / thumbnail downloader (13652): (this First) Size of the cache: 0 02-18 10: 59: 03.20 9: I / Thumbnail Droploader (13652): (after) Cache Size: 0 02-18 10: 59: 03.20 9: I / Thumbnail Downloader (13652): Failed to cache!  

This item was not cached.

I tried to expand the caching memory size, but the result was not changed.

How to solve this problem?


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -