1

所以在我正在使用的项目中,图片存储到/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文件提供程序的路径?

4

1 回答 1

0

我没有找到关于在外部路径中为文件提供程序指定路径的问题的确切解决方案,但是我确实通过将文件保存到路径Environment.getExternalStorageDirectory()而不是指定 /sdcard/ 来解决它。

于 2016-01-25T23:30:01.183 回答