2个URI的区别
我正在尝试保存附件(彩信和 GMail)
Uri uri;
uri = Uri.parse("content://mms/part/" + mmsPartId);
uri = Uri.parse("content://gmail-ls/messages/[email protected]/messageId/attachments/0.1/BEST/true");
InputStream inputStream = getContentResolver().openInputStream(uri);
openInputStream 对于彩信工作正常,但对于 GMail 我收到错误: “打开SD卡上带有附件直接路径的附件”
我不明白什么是“附件直接路径”?
I'm trying to save attachment (mms and GMail)
Uri uri;
uri = Uri.parse("content://mms/part/" + mmsPartId);
uri = Uri.parse("content://gmail-ls/messages/[email protected]/messageId/attachments/0.1/BEST/true");
InputStream inputStream = getContentResolver().openInputStream(uri);
openInputStream works fine for mms, but for GMail i got error:
"open attachments that are on the sd card with the direct path to the attachment"
I don't understand what "direct path to the attachment"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用这样的手写字符串非常可能会导致您编写的应用程序崩溃。特别是,SDK 中没有与 gmail 交互的定义。 Gmail不是 SDK 的一部分。你不能指望它能起作用;这是gmail的一个实现细节,可以随时任意更改。 (Gmail 甚至不是该平台的一部分;它基本上只是一些随机的应用程序,恰好是由 Google 编写的,您正试图深入其中。)
Using hand-written strings like this is very likely to result in you writing an app that breaks. In particular -- there is no definition in the SDK for interacting with gmail. Gmail is not part of the SDK. You can't count on this working; it is an implementation detail of gmail that can change arbitrarily at any time. (Gmail isn't even part of the platform; it is basically just some random app, that happens to be written by Google, that you are trying to poke inside of.)