Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import java.io.IOException;
import java.io.InputStream;

public class Main {

    public static Bitmap getAssetBitmap(Context context, String path) {
        Bitmap mBitmap = null;
        try {
            InputStream is = context.getAssets().open(path);
            mBitmap = BitmapFactory.decodeStream(is);
            is.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return mBitmap;
    }
}