Android examples for App:Assets Image
get Drawable By Name from Asset
//package com.java2s; import android.content.res.AssetManager; import android.graphics.drawable.Drawable; import java.io.IOException; public class Main { public static String MainPath = "smsfaces"; public static Drawable getDrawableByName(AssetManager mgr, String folder, String filename) { try {//www. j a va2 s.co m Drawable d = Drawable.createFromStream( mgr.open(MainPath + "/" + folder + "/" + filename), null); return d; } catch (IOException e) { return null; } } }