//调起所有文件 包括相册 视频 相机 录像
private fun getAllFile() {
//カメラの起動Intentの用意
val photoName = System.currentTimeMillis().toString() + ".jpg"
val contentValues = ContentValues()
contentValues.put(MediaStore.Images.Media.TITLE, photoName)
contentValues.put(MediaStore.Images.Media.MIME_TYPE, "image/*")
mUri = context?.contentResolver?.insert(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
contentValues
)
val intentCamera = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
intentCamera.putExtra(MediaStore.EXTRA_OUTPUT, mUri)
uiApplication!!.setCommonUri(mUri!!)
var mUriVideo: Uri? = null
val videoName = System.currentTimeMillis().toString() + ".mp4"
val contentValues2 = ContentValues()
contentValues2.put(MediaStore.Images.Media.TITLE, videoName)
contentValues2.put(MediaStore.Images.Media.MIME_TYPE, "video/*")
mUriVideo = co
Android 调起文件,相册 实现选择图片与视频
最新推荐文章于 2024-07-02 14:40:37 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)