Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.drawable.Drawable;
import android.os.Environment;

public class Main {
    public static Drawable getDrawableFromFile(String fileName) {
        Drawable d = Drawable.createFromPath(getAbsoluteFilePath(fileName));
        return d;
    }

    public static String getAbsoluteFilePath(String fileName) {
        String filePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + fileName;
        return filePath;
    }
}