title: After saving my bitmap to a file the size is 0 KB
body: <p>I have a android app where I have a bitmap and I want to save it to the application data folder. The file is there after execution, but its 0kb and no picture is inside.</p>
  
  <p>Where is the bug?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>ByteArrayOutputStream bytes = new ByteArrayOutputStream();
  myBitmap.compress(Bitmap.CompressFormat.JPEG, 40, bytes);
  
  File f = new File(projDir + File.separator + newPath);
  try {
      f.createNewFile();
      FileOutputStream fo = new FileOutputStream(f);
      fo.write(bytes.toByteArray());
      fo.close();
  } catch (IOException e) {
      e.printStackTrace();
  }
  </code></pre>