Android update photo album, Android update photo album after taking photo

method one:

Uri updateUri = Uri.fromFile (file);

Intent updateIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, updateUri);

sendBroadcast (updateIntent);

Method Two:

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);

Reference: http://blog.sina.com.cn/s/blog_5689926f0100udgo.html

Original text: http://www.cnblogs.com/zfg-technology/p/3875232.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324364921&siteId=291194637