【发布时间】:2016-01-25 20:03:22
【问题描述】:
所以在我正在处理的项目中,图片存储到/sdcard/<app made folder>,我们通过使用文件提供程序将这里存储的图片共享给其他应用程序。因此,当文件提供程序尝试获取文件的 uri 时,它会调用 getCanonicalPath(),返回路径 /storage/emulated/legacy/<our folder>/<our file>。
通过文件提供程序进行调试,我看到当它检查文件路径时,它会通过 /storage/emulated/0 进行检查
我已经尝试过:
<external-path path = "storage/emulated/legacy/JCG Camera" name="share_cam_images2" />
在 filepaths.xml 中,但是当文件提供程序检查它时,它会将其解析为:<storage/emulated/0/storage/emulated/legacy/JCG Camera/<file>
如何为文件提供者指定路径/storage/emulated/legacy?
【问题讨论】:
标签: android android-sdcard android-fileprovider