Saved image takes minutes to appear in Gallery
<p>I'm saving a bitmap in the SD card and I called the <code>Intent.ACTION_MEDIA_MOUNTED</code> right after.</p>

<p>It displays in the Gallery but it takes about 5 minutes for the image to appear. Is there any way to make it instantaneous?</p>

<pre><code>File newFile = new File(newFilename);
if (newFile.exists()) { 
    newFile.delete();
}

try {
   FileOutputStream out = new FileOutputStream(newFile);
   bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
   out.flush();
   out.close();
   context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));
   Toast.makeText(context, "Photo will appear in the Gallery in a few minutes.", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
   e.printStackTrace();
}
</code></pre>
