如何使用Storage Access Framework(SAF)在可移动SD卡中获取绝对路径? [英] How to get absolute paths in the removable SD-card using Storage Access Framework (SAF)?

查看:177
本文介绍了如何使用Storage Access Framework(SAF)在可移动SD卡中获取绝对路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以从特定的文件夹&获取绝对路径吗?使用存储访问框架(SAF)位于可移动SD卡中的文件?

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)?

谢谢

推荐答案

否,即使您可以,也无法访问它们,除非它们碰巧位于可移动媒体上的几个位置之一中,您具有读取权限(例如,getExternalFilesDirs()).

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()).

Storage Access Framework返回指向文档的Uri值.使用ContentResolver和类似openInputStream()的方法来使用它们.这大致等效于获取指向文档的URL值,并使用HTTP客户端打开流以使用这些文档的内容.

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.

这篇关于如何使用Storage Access Framework(SAF)在可移动SD卡中获取绝对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆