Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.IOException;
import java.io.InputStream;
import android.content.res.AssetManager;
import android.graphics.drawable.Drawable;

public class Main {
    public static Drawable loadImage(String name, AssetManager assetManager) {
        try {
            InputStream ims = assetManager.open(name);
            return Drawable.createFromStream(ims, null);
        } catch (IOException ex) {
            //throw new RuntimeException( "Image " + name + " could not be loaded" );
            return null;
        }
    }
}