Display hidden user-taken picture on android
<p>I'm developping a sort of camera app, and I need it to save each picture in a particular folder on my android device:</p>

<p>picture 1 will go in Project/1/Image.jpg</p>

<p>picture 2 will go in Project/2/Image.jpg</p>

<p>and so forth...</p>

<p>Here is the method that saves the images:</p>

<pre><code>    private void SavePicture( byte[] imageData ) 
    {
        File path = new File( Environment.getExternalStoragePublicDirectory ( Environment.DIRECTORY_PICTURES ) + "/Project" );
        boolean success = true;
        if( !path.exists() ) 
        {
            success = path.mkdir();
        }

        if( success ) 
        {
            int iterator = 0;
            do 
            {
                ++iterator;
                path = new File( path + "/"+Integer.toString(iterator) );
            }while( path.exists() );
            success = path.mkdir();
        }

        if(!success) 
        {
            Log.d("ACTIVITY", "failed at creating directory!");
        }

        String filename = "Image.jpg";
        try 
        {
            Uri uriTarget = Uri.fromFile( new File( path, filename ) );
            OutputStream output = getContentResolver().openOutputStream( uriTarget );
            output.write( imageData );
            output.flush();
            output.close();
        }
        catch( FileNotFoundException e ) 
        {
            Log.d( "ACTIVITY", "Save image failed due to FileNotFoundException: " + e );
        }
        catch( IOException e ) 
        {
            Log.d( "ACTIVITY", "Save image failed due to IOException: " + e );
        }
    }
</code></pre>

<p>In this code I start with a loop to find to which number I'm at so if I have folder 1,2,3,4 I will create folder 5. </p>

<p>My problem is the following: When it goes through that loop the do{...}while(path.exists()); finds each of the folder I previously created. But when I look in my gallery I can't see any picture or folder. I've also looked from the file system of the computer into the android device but couldn't find any folder. </p>

<p>My guess is that the folder are hidden (it's only an assumption...)</p>

<p>Thanks</p>
