手记

android开发:LruCache

    private static LruCache<String, Bitmap> drawableCache;
drawableCache = new LruCache<String, Bitmap>(CACHE_MAX_SIZE) {
            @Override
            protected void entryRemoved(boolean evicted, String key, Bitmap oldValue, Bitmap newValue) {
                if (oldValue != newValue)
                    oldValue.recycle();
            }
        };
0人推荐
随时随地看视频
慕课网APP