title: java.io.FileNotFoundException: /storage/emulated/0/saved_images/grub.jpg: open failed: ENOENT (No such file or directory)
body: <p>Am using the below code to save an image in sd card but I keep on getting this below exception</p>
  
  <pre><code>private void SaveImage(Bitmap finalBitmap,String filename) {
  
      String root = Environment.getExternalStorageDirectory().toString();
      File myDir = new File(root + "/saved_images");    
      myDir.mkdirs();
  
      String fname = filename;
      File file = new File (myDir, fname);
      if (file.exists ()) file.delete (); 
      try {
             FileOutputStream out = new FileOutputStream(file);
             finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
             out.flush();
             out.close();
  
      } catch (Exception e) {
             e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Am I missing out anything here?</p>