//拍照完成
//第一种方法
// val absolutePath = mMediaStoreUtils.getCurrentAbsolutePath()
// val fileName = File(absolutePath).name
// MediaStore.Images.Media.insertImage(
// contentResolver,
// absolutePath, fileName,
// fileName)
//第二种跟新方法
//val currentUri = mMediaStoreUtils.getCurrentUri()
//这个广播的目的就是更新图库,发了这个广播进入相册就可以找到保存的图片了
//sendBroadcast(Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, currentUri!!))
//第三种更新方法
MediaScannerConnection.scanFile(
this,
arrayOf(mMediaStoreUtils.getCurrentAbsolutePath()),
arrayOf("image/jpeg")
) { path, uri ->
}
网友评论