Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.io.InputStream;
import android.content.Context;

import android.graphics.drawable.Drawable;

public class Main {
    public static Drawable loadDrawableFromAsset(Context context, String path) throws IOException {
        InputStream ims = context.getAssets().open(path);
        // load image as Drawable
        Drawable d = Drawable.createFromStream(ims, null);

        return d;
    }
}