How to get absolute paths in the removable SD-card using Storage Access Framework (SAF)?

会有一股神秘感。 提交于 2019-12-24 01:25:16

问题


Is there any way to get the absolute path from specific Folders & Files located in the removable SD-card, using the Storage Access Framework (SAF)?

Thanks


回答1:


No, and even if you could, you would not be able to access them, unless they happened to be in one of the couple of locations on removable media for which you have read access (e.g., getExternalFilesDirs()).

The Storage Access Framework returns Uri values pointing to documents. Use ContentResolver and methods like openInputStream() to work with them. This is roughly equivalent to getting URL values pointing to documents and using an HTTP client to open a stream to work with the contents of those documents.



来源:https://stackoverflow.com/questions/34576911/how-to-get-absolute-paths-in-the-removable-sd-card-using-storage-access-framewor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!