Home
Sign Up
Sign In
V2EX
›
Android
Android 有没有办法用一段代码生成 content uri
RichardY
·
May 15, 2022
· 13467 views
This topic created in 1634 days ago, the information mentioned may be changed or developed.
想要通过简单的代码达到:
根据一个文件的本地路径生成一个 content uri ( content://
xxxx.xxx/xxx.xx
这种形式)
如果能用 shell 生成的话更好了。
content
URI
生成
代码
2 replies
•
2022-05-16 10:57:16 +08:00
AoEiuV020CN
May 16, 2022
1
> 根据一个文件的本地路径生成一个 content uri
这不就是 FileProvider.getUriForFile 的使用场景吗?
content 是对应 provider 的,provider 对应一个安卓应用,纯 linux shell 命令不涉及安卓应用应该没办法生成可用的 content uri 的,
lisongeee
May 16, 2022
1
2
https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/README-CN.md#uri-%E7%9B%B8%E5%85%B3---uriutilsjava
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
2034 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms ·
UTC 16:28
·
PVG 00:28
·
LAX 08:28
·
JFK 11:28
♥ Do have faith in what you're doing.
❯