I'm using this answer to help solve my out of memory issue. The solution was to move all the drawables to a new drawable folder inside the assets folder and use this function
public static Drawable getAssetImage(Context context, String filename) throws IOException {
AssetManager assets = context.getResources().getAssets();
InputStream buffer = new BufferedInputStream((assets.open("drawable/" + filename + ".png")));
Bitmap bitmap = BitmapFactory.decodeStream(buffer);
return new BitmapDrawable(context.getResources(), bitmap);
}
My question is how do I use this function within my Activity? Is there an example of this?