try { MediaStore.Images.Media.insertImage(getApplicationContext().getContentResolver(), file.getAbsolutePath(), fileName, null); } catch(FileNotFoundException e) { e.printStackTrace(); } getApplicationContext().sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(file)));
转载于:https://my.oschina.net/u/3486497/blog/1071062