I am trying to load an image from the asset
folder and then set it to an ImageView
. I know it\'s much better if I use the R.id.*
for t
public static Bitmap getImageFromAssetsFile(Context mContext, String fileName) {
Bitmap image = null;
AssetManager am = mContext.getResources().getAssets();
try {
InputStream is = am.open(fileName);
image = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return image;
}