Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.res.AssetManager;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import java.io.IOException;

public class Main {
    /**
     * Load an image from an asset file.
     *
     * @param assetManager
     * @param imageAssetPath Path to image
     * @return image object
     * @throws IOException
     */
    public static Bitmap loadBitmapAsset(AssetManager assetManager, String imageAssetPath) throws IOException {
        return BitmapFactory.decodeStream(assetManager.open(imageAssetPath));
    }
}