Android examples for android.content.res:AssetManager
get Bitmap From Asset
import android.content.Context; import android.content.pm.PackageInfo; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.Drawable; import android.lemon.assist.Check; import android.lemon.config.BaseConfig; import android.os.Environment; import android.os.StatFs; import java.io.InputStream; public class Main{ public static Bitmap getBitmapFromAsset(Context context, String fileName) { Bitmap bit = null;/*from w w w.jav a 2 s .c om*/ try { AssetManager assetManager = context.getAssets(); InputStream is = assetManager.open(fileName); bit = BitmapFactory.decodeStream(is); } catch (Exception e) { } return bit; } }