我想使用该路径将该视频复制到另一个目录,但引发我的错误说我的 URI 或路径不存在。
probar.setOnClickListener({
val selectedImageUri2=globalVariable.video//here I just saved the uri path of the intent
if(!CheckPermissionFromDevice()){
requestPermission()
} else {
val sourcePath = Environment.getExternalStorageDirectory().absolutePath +"/"+ selectedImageUri2.toString()
Toast.makeText(this, "SOURCE PATH:: "+sourcePath, Toast.LENGTH_SHORT).show()
println("SOURCE"+sourcePath)
val source= File(sourcePath)
val destinationPath = Environment.getExternalStorageDirectory().absolutePath + "/AudioFiscalia/"
val destination = File(destinationPath)
try {
FileUtils.copyFile(source, destination)
Toast.makeText(applicationContext, "TRY BIEN", Toast.LENGTH_LONG).show()
} catch (e: IOException) {
e.printStackTrace()
Toast.makeText(applicationContext, "CATCH"+e.toString(), Toast.LENGTH_LONG).show()
println("error"+e.toString())
}
}
})
这是我的错误:源'/storage/emulated/0/content:/com.android.externalstorage.documents/document/primary%3ADCIM%2FHDCamera%2FVID_20190903_114707.mp4'不存在