diff options
Diffstat (limited to 'src/com/android/bitmap/DecodeTask.java')
-rw-r--r-- | src/com/android/bitmap/DecodeTask.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/bitmap/DecodeTask.java b/src/com/android/bitmap/DecodeTask.java index 03b8445..e227446 100644 --- a/src/com/android/bitmap/DecodeTask.java +++ b/src/com/android/bitmap/DecodeTask.java @@ -439,9 +439,11 @@ public class DecodeTask extends AsyncTask<Void, Void, ReusableBitmap> { } catch (IOException ignored) { } } + + // Put result in cache, regardless of null. The cache will handle null results. + mCache.put(mKey, result); if (result != null) { result.acquireReference(); - mCache.put(mKey, result); if (DEBUG) { Log.d(TAG, "placed result in cache: key=" + mKey + " bmp=" + result + " cancelled=" + isCancelled()); |