title: saved image file is stored with 0kb in sdcard and the folder is not even visible in gallery
body: <p>in main activity i have a button takeApic that will start the intent to access the camera then on onActivityResult i have passed the bitmap to other activity(ShowActivity) </p>
  
  <pre><code>               @Override
                protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == CAMERA_PIC_REQUEST) {
          // 2
          Bitmap show_img = (Bitmap) data.getExtras().get("data");
          Intent mIntent = new Intent(MainActivity.this,ShowActivity.class);
          mIntent.putExtra("BitmapImage", show_img);
          startActivity(mIntent);
  
      }
  </code></pre>
  
  <p>then ShowActivity set the taken image (i have received through intent) in an imageview</p>
  
  <pre><code>        Intent mIntent = getIntent();
      /** retrieve the string extra passed */
      Bitmap our_img = (Bitmap) mIntent.getParcelableExtra("BitmapImage");
      mImage.setImageBitmap(our_img);
  </code></pre>
  
  <p>when the button Save is pressed on ShowActivity is should save the image here is my code </p>
  
  <pre><code>                 FileOutputStream output;
  
  
          File filepath = Environment.getExternalStorageDirectory();
  
          // Create a new folder AndroidBegin in SD Card
          File dir = new File(filepath.getAbsolutePath() + "/Hello/");
  
          dir.mkdirs();
  
          // Create a name for the saved image
          File file = new File(dir, pic_name+".png");
  
          // Notify the user on successful save
          Toast.makeText(this, "Image Saved to SD Card", Toast.LENGTH_SHORT).show();
          try {
  
              // Image starts saving
              output = new FileOutputStream(file);
  
              our_img.compress(Bitmap.CompressFormat.PNG, 100, output);
  
              output.flush();
              output.close();
          }
          // Catch exceptions
          catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
          //  to see saved images in the gallery view.
  
          sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
                  Uri.parse("file://"
                          + Environment.getExternalStorageDirectory())));
  </code></pre>
  
  <p>*the program can take picture
  *create a folder and image file too
  BUT
  the file created is of 0KB
  and the folder is not visible in gallery</p>
  
  <p>p.s i have given permissions in manifest to write the external storage and access the camera </p>
  
  <p>I will be very very thankful to you if you can please provide me the solution please !!!</p>