public void putBitmap(String url, Bitmap bitmap) { try { mImageCache.putBitmap(createKey(url), bitmap); if (mSecondCache != null) { mSecondCache.putBitmap(createKey(url), bitmap); } } catch (NullPointerException e) { throw new IllegalStateException("Disk Cache Not initialized"); } }
public Bitmap getBitmap(String url) { try { Bitmap bm = mImageCache.getBitmap(createKey(url)); if (bm == null && mSecondCache != null) { bm = mSecondCache.getBitmap(createKey(url)); } return bm; } catch (NullPointerException e) { throw new IllegalStateException("Disk Cache Not initialized"); } }