How to make "drawable" files accessible through the code
<pre><code>public static Bitmap loadBitmap(Context context, String filename){
        AssetManager assets = context.getResources().getAssets();
        InputStream buf = null;
        try {
            buf = new BufferedInputStream((assets.open("drawable/black_circle.png")));
        } catch (IOException e) {
            e.printStackTrace();
        }
        Bitmap bitmap = BitmapFactory.decodeStream(buf);
        return bitmap;
    }
</code></pre>

<p>when I use the code above the system gives the following error</p>

<pre><code>09-27 12:33:44.470: W/System.err(18554): java.io.FileNotFoundException: drawable/black_circle.png
09-27 12:33:44.470: W/System.err(18554):    at android.content.res.AssetManager.openAsset(Native Method)
09-27 12:33:44.470: W/System.err(18554):    at android.content.res.AssetManager.open(AssetManager.java:315)
09-27 12:33:44.470: W/System.err(18554):    at android.content.res.AssetManager.open(AssetManager.java:289)
</code></pre>

<p>I'm running the code on a Samsung Galaxy, through Eclipse. How to make this work?</p>

<p>I need to change the file name dynamically. </p>
