通知系统相册收录新图片

来源:互联网 发布:河南知满天 编辑:程序博客网 时间:2024/04/29 03:50

private void galleryAddPic() {    Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);    File f = new File(mCurrentPhotoPath);    Uri contentUri = Uri.fromFile(f);    mediaScanIntent.setData(contentUri);    this.sendBroadcast(mediaScanIntent);}


Note: If you saved your photo to the directory provided by getExternalFilesDir(), the media scanner cannot access the files because they are private to your app.


官网地址:http://developer.android.com/training/camera/photobasics.html

0 0
原创粉丝点击