Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Main {
    private static BitmapFactory.Options opt = new BitmapFactory.Options();

    public static Bitmap getBitmapFromResId(Resources res, int resId) {
        opt.inPurgeable = true;
        return BitmapFactory.decodeResource(res, resId, opt);
    }
}