how to save multiple bitmap images to internal storage and read into a list activity
<p>How can i write a bitmap image to internal storage, (prefer if i can save the bit map in my Own Directory ex "/data/data/com.myapp/myfolder/img1.png") i need to save the multiple images into this directory.after saving multiple images to above directory i need to show the saved images in a list activity,</p>

<p>Method Use to save the Image to internal Storage</p>

<pre><code>private void saveToInternalSorage(Bitmap bitmapImage,String filename){
        ContextWrapper cw = new ContextWrapper(getApplicationContext());
        File directory = cw.getDir("myfolder", Context.MODE_PRIVATE);
        File mypath=new File(directory,filename+ ".png");

        FileOutputStream fos = null;
        try {
           // fos = openFileOutput(filename, Context.MODE_PRIVATE);
            System.out.println("mypath = "+mypath);
            fos = new FileOutputStream(mypath);

            // Use the compress method on the BitMap object to write image to the OutputStream
            bitmapImage.compress(Bitmap.CompressFormat.PNG, 100, fos);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
</code></pre>

<p>Read the images from Internal Storage.</p>

<pre><code> private File [] loadInternalImages(){
        ContextWrapper cw = new ContextWrapper(getApplicationContext());
        File directory = cw.getDir("myfolder", Context.MODE_PRIVATE);
        File[] imageList = directory.listFiles();
        if(imageList == null){
            imageList = new File[0];
        }
        Log.i("My","ImageList Size = "+imageList.length);
        return imageList;
    }
</code></pre>

<p>Regards,
Sam</p>
