I'm trying to use this code that I've seen on multiple posts throughout stackoverflow
public static Bitmap loadBitmap(Context context, String filename) throws IOException {
AssetManager assets = context.getResources().getAssets();
InputStream buf = new BufferedInputStream((assets.open("drawable/" + filename)));
Bitmap bitmap = BitmapFactory.decodeStream(buf);
return bitmap;
}
but I'm getting a "FileNotFoundException: drawable/filename". I definitely have a file with the name I'm trying to load in the drawable folders. Any ideas? I've tried with and without the file extension, tried putting the file into every folder and tried multiple phones/emulator.