title: update android image gallery with newly created bitmap
body: <p>I'm trying to save an image file to external storage. I can save the picture to the sdcard but it doesn't show up in Androids gallery application. I've tried this approach:</p>
  
  <pre><code>File path = Environment.getExternalStorageDirectory();
              File f = new File(path + "/mydirectory/" + imageName + "_" +     System.currentTimeMillis() + ".jpg");
              FileOutputStream fos = new FileOutputStream(f);
              f.mkdirs();
              b.compress(CompressFormat.JPEG, 100, fos);
              fos.close();
  
              Uri contentUri = Uri.fromFile(f);
              Intent mediaScanIntent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
              mediaScanIntent.setData(contentUri);
              getApplicationContext().sendBroadcast(mediaScanIntent);
  </code></pre>
  
  <p>But it doesn't show up in the gallery. Can anyone point me in the right direction to solve this problem?</p>