title: saving picture from my app
body: <p>The idea of my app is to capture image from camera then crop specified area from it.</p>
  
  <p>The problem :
        When i save the cropped image in my sd card for the first time to launch the app, it saved properly. but when run my app one more time and take image then crop it. when save it the first image that take and crop at first time appear in the sd card not the current one.</p>
  
  <p>This is my code for save images:</p>
  
  <pre><code>public static void save(Activity activity, Bitmap bm, String name) {
      OutputStream outStream = null;
  
      File externalFilesDir = activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES);
      File outFile = new File(externalFilesDir, "IDOCR" + File.separator + "Numbers");
  
      if (!outFile.exists())
          outFile.mkdirs();
  
      File number = new File(outFile, name + ".PNG");
      //if (number.exists())
      //  number.delete();
      try {
          //outStream = new FileOutputStream(new File(path));
          outStream = new FileOutputStream(number);
          bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);
          outStream.flush();
          outStream.close();
  
          bm.recycle();
          System.gc();
  
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  </code></pre>