title: Android save bmp image
body: <p>I'm trying to save a captured .bmp file to sdcard.
  Here is a fragment of code which is responsible for this: </p>
  
  <pre><code>    String root = Environment.getExternalStorageDirectory().toString();
      File mFolder = new File(root + "/mFolder");
  
      if (!mFolder.exists()) 
      {
          mFolder.mkdir();
      }
      String strF = mFolder.getAbsolutePath();
      File mSubFolder = new File(strF + "/MyApp-SubFolder");
  
      if (!mSubFolder.exists()) 
      {
          mSubFolder.mkdir();
      }
      String s = "myfile.png";
  
      File f = new File(mSubFolder.getAbsolutePath(),s);
      String strMyImagePath = f.getAbsolutePath();
      FileOutputStream fos = null;
      try 
      {
          fos = new FileOutputStream(f);
          bmp.compress(Bitmap.CompressFormat.PNG,70, fos);
  
          fos.flush();
          fos.close();
          Log.d("asd", "yeah!");
      //  MediaStore.Images.Media.insertImage(getContentResolver(), b, "Screen", "screen");
      }catch (FileNotFoundException e) {
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>But there is an error: </p>
  
  <blockquote>
    <p>images are invalid and its size are 0kb</p>
  </blockquote>
  
  <p>What am I doing wrong? </p>