How to get absolute paths in the removable SD-card

2019-07-12 20:02发布

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条回答
走好不送
2楼-- · 2019-07-12 20:14

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.

查看更多
登录 后发表回答