public void clearMemoryCache(String uri) { MemoryCacheKey key = new MemoryCacheKey(uri, null); if (mMemoryCache != null) { while (mMemoryCache.containsKey(key)) { mMemoryCache.remove(key); } } }
/** * Get the bitmap from memory cache. * * @param uri Unique identifier for which item to get * @param config * @return The bitmap if found in cache, null otherwise */ public Bitmap getBitmapFromMemCache(String uri, BitmapDisplayConfig config) { if (mMemoryCache != null && globalConfig.isMemoryCacheEnabled()) { MemoryCacheKey key = new MemoryCacheKey(uri, config); return mMemoryCache.get(key); } return null; }
private void addBitmapToMemoryCache( String uri, BitmapDisplayConfig config, Bitmap bitmap, long expiryTimestamp) throws IOException { if (uri != null && bitmap != null && globalConfig.isMemoryCacheEnabled() && mMemoryCache != null) { MemoryCacheKey key = new MemoryCacheKey(uri, config); mMemoryCache.put(key, bitmap, expiryTimestamp); } }
public void clearMemoryCache() { if (mMemoryCache != null) { mMemoryCache.evictAll(); } }
public void setMemoryCacheSize(int maxSize) { if (mMemoryCache != null) { mMemoryCache.setMaxSize(maxSize); } }