From: http://www.cnblogs.com/lingyun1120/archive/2011/12/27/2303560.html
FoundProgramAfter saving the image to sdcard, the image cannot be found in the album. The image will appear only after the sdcard is reloaded;
After the original image is saved locally, you need to add the following to the notification album:CodeJust fine:
Uri localuri = URI. fromfile (imagefile );
Intent localintent = new intent (intent. action_media_scanner_scan_file, localuri );
Sendbroadcast (localintent );
Imagefile is the file object of an image;
Or
Contentvalues localcontentvalues = new contentvalues ();
Localcontentvalues. Put ("_ data", imagefile. tostring ());
Localcontentvalues. Put ("Description", "Save image ---");
Localcontentvalues. Put ("mime_type", "image/JPEG ");
Contentresolver localcontentresolver = getcontentresolver ();
Uri localuri = mediastore. Images. Media. external_content_uri;
Localcontentresolver. insert (localuri, localcontentvalues );
Below is my own method to refresh the root directory
Sendbroadcast (new intent (intent. action_media_mounted, Uri. parse ("file: //" + environment. getexternalstoragedirectory ())));