title: Android canvas save always java.io.IOException: open failed: ENOENT (No such file or directory)
body: <p>I have a canvas application. I'm trying to create a signature app with <code>Canvas</code> + <code>onTouchListener</code>.</p>
  
  <p>This is my save method, where I try to save the signature to an image:</p>
  
  <pre><code>private void save() {
      hideMenuBar();
      View content = this;
      content.setDrawingCacheEnabled(true);
      content.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
      Bitmap bitmap = content.getDrawingCache();
      String path = Environment.getExternalStorageDirectory().getAbsolutePath();
      String imgPath = path+"/imotax/capture/spop/ttd/image" + "temp" + ".jpg";
      File file = new File(imgPath);
      FileOutputStream ostream;
      try {
          file.createNewFile();
          ostream = new FileOutputStream(file);
          bitmap.compress(CompressFormat.JPEG, 100, ostream);
          ostream.flush();
          ostream.close();
          Toast.makeText(getContext(), "image saved", 5000).show();
      } catch (Exception e) {
          e.printStackTrace();
          Log.i("ttd", e.toString());
          Toast.makeText(getContext(), "Failed To Save", 5000).show();
          showMenuBar();
      }
  }
  </code></pre>
  
  <p>I don't know why, but it always errors or enters the <code>catch</code> statement with this error:</p>
  
  <pre><code>java.io.IOException: open failed: ENOENT (No such file or directory)
  </code></pre>