Bitmap bitmap = imageMap.get(url);
MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, "myPhoto", "");
将bitmap保存到系统相册,结果打开相册一直找不到保存的图片。但是重启手机之后发现能在相册中找到。研究之后发现,需要在将照片写入相册之后往相册中刷新下相册环境:
[java]
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));