Here you can find the source of loadBitmapFromAssets(Context context, String name)
public static Bitmap loadBitmapFromAssets(Context context, String name)
//package com.java2s; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import java.io.IOException; import java.io.InputStream; public class Main { public static Bitmap loadBitmapFromAssets(Context context, String name) { try {/*from w w w. j av a2 s . c o m*/ InputStream is = context.getAssets().open(name); Bitmap bitmap = BitmapFactory.decodeStream(is); return bitmap; } catch (IOException e) { e.printStackTrace(); } return null; } }