title: How to create a folder and save more than one files to that folder in android?
body: <p>Im using the code as shown bellow for saving a jpg file to sdcard on a button click. </p>
  
  <pre><code>OutputStream fOut = null;
              try 
              {
                  fOut = new FileOutputStream(String.format("/sdcard/%d.jpg", System.currentTimeMillis()));
                  sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));
                  mMergedLayersBitmap.compress(Bitmap.CompressFormat.JPEG, 85, fOut);
                  fOut.flush();
                  fOut.close();
              } 
              catch (FileNotFoundException e) 
              {
                  e.printStackTrace();
              } 
              catch (IOException e)
              {
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>for saving the image to a folder, I rewrite the code as shown bellow</p>
  
  <pre><code>OutputStream fOut = null;
              //Create Folder
                File folder = new File(Environment.getExternalStorageDirectory().toString()+"/draw/Images");
                folder.mkdirs();
  
                //Save the path as a string value
                String extStorageDirectory = folder.toString();
  
                //Create New file and name it draw.jpg
                File file = new File(extStorageDirectory, "draw.jpg");
                try 
                  {
                      fOut = new FileOutputStream(file);
                      mMergedLayersBitmap.compress(Bitmap.CompressFormat.JPEG, 85, fOut);
                      fOut.flush();
                      fOut.close();
                  } 
                  catch (FileNotFoundException e) 
                  {
                      e.printStackTrace();
                  } 
                  catch (IOException e)
                  {
                      e.printStackTrace();
                  }
  </code></pre>
  
  <p>Now its rewriting the image when I am click the save button second time. I want to save the whole image that im saving to a folder. I don't know how to change my code for this requirement. If anyone know about this, please help me..</p>