File exist in assets but is throwing an FileNotFoundException
<p>I am trying to access photos saved in the assets folder, my code doen't work all the times.</p>

<p>i have 16 sub-folders in assets with photos in <strong>png</strong> format each have between <strong>30kb ~ 60kb</strong></p>

<p>Each folder have between 100 and 400 photos</p>

<p>Full size of assets folder is 113mb.</p>

<p>My code <strong>stoped working when i added more photos to the assets</strong></p>

<pre><code> public Bitmap getImg(String ID, String pic){
    InputStream istr = null;
    try {
        //Exemple: II/1.png 
        istr =  getAssets().open(ID + "/" + pic +".png");
    } catch (IOException e) {
        e.printStackTrace();
    }
    return BitmapFactory.decodeStream(istr);
}
</code></pre>

<p>When i run this code i get a FileNotFoundException, but the file existis (i am awere that file names are case sensitive, extension is in lowercase and pic names are numbers).</p>

<p>I think this is something to do with the file size, because i compressed all photos in one of the subfolders and it started to work again, but on the other folders (that have alot more photos) don't, even after compressing i keep getting a FileNotFoundException.</p>

<p>is there a better way to store or access the photos?</p>