所以在我正在使用的项目中,图片存储到/sdcard/<app made folder>
,我们通过使用文件提供程序将存储在这里的图片共享给其他应用程序。因此,当文件提供程序尝试获取文件的 uri 时,它会调用 getCanonicalPath() 来返回 path /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
文件提供程序的路径?