Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;

import android.support.v4.util.LruCache;

public class Main {
    private static LruCache<String, Bitmap> bitmapCache;

    private static void checkBitmapCache() {
        if (bitmapCache == null) {
            bitmapCache = new LruCache<String, Bitmap>((int) Runtime.getRuntime().maxMemory() / 8) {
                @Override
                protected int sizeOf(String key, Bitmap bitmap) {
                    return bitmap.getRowBytes() * bitmap.getHeight();
                }
            };
        }
    }
}