FileChannel src = new FileInputStream(source).getChannel();
FileChannel dst = new FileOutputStream(destination).getChannel();
dst.transferFrom(src, 0, src.size()); 源路径是--> /storage/emulated/0/Pictures/IMG_20210630_182546.jpg
这是目标文件夹--> /storage/emulated/0/Android/data/com.tp.qa/files/temp
目标镜像名称--> /gallery1625059659.jpg
从上述来源复制文件时是否有问题?
发布于 2021-06-30 23:38:08
在android 11中,不允许直接访问存储。这是如何在Android11中使用作用域权限的documentation。你可以试试这个solution。在我的例子中,这是可行的。
https://stackoverflow.com/questions/68195800
复制相似问题