Code example for LruCache

Methods: get

            mMemoryCache.put(key, bitmap);
    protected Bitmap getBitmapFromMemCache(String key) {
        return mMemoryCache.get(key);
    public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId,
                                                         int reqWidth, int reqHeight) {
        // First decode with inJustDecodeBounds=true to check dimensions 
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeResource(res, resId, options);
        // Calculate inSampleSize 
        options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
Stop searching for code, let great code find you!  Add Codota to your java IDE