// 把content://格式的Uri转成绝对路径,就是拼接一下字符串
Uri uri = data.getData();
path = "/storage/emulated/0/"+uri.getLastPathSegment ().substring(8);
File file = new File(path);
Uri 转 绝对路径 转 File
最新推荐文章于 2023-09-19 19:32:19 发布
本文介绍了一种将content://格式的Uri转换为设备上绝对路径的方法。通过拼接字符串,可以将Uri的最后一段路径与固定前缀结合,形成完整的文件路径。此方法适用于Android平台上的文件操作。
341

被折叠的 条评论
为什么被折叠?



