Here you can find the source of loadBitmapAsset(Context context, String asset)
public static Bitmap loadBitmapAsset(Context context, String asset)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.util.Log; import java.io.IOException; import java.io.InputStream; public class Main { private static final String TAG = "FeedMe"; public static Bitmap loadBitmapAsset(Context context, String asset) { InputStream is = null;/* ww w. j av a 2s .co m*/ Bitmap bitmap = null; try { is = context.getAssets().open(asset); if (is != null) { bitmap = BitmapFactory.decodeStream(is); } } catch (IOException e) { Log.e(TAG, e.toString()); } finally { if (is != null) { try { is.close(); } catch (IOException e) { Log.e(TAG, "Cannot close InputStream: ", e); } } } return bitmap; } }