简体   繁体   English

2 URI之间的区别

[英]Difference between 2 URI

I'm trying to save attachment (mms and GMail) 我正在尝试保存附件(彩信和Gmail)

Uri uri; 
uri = Uri.parse("content://mms/part/" + mmsPartId);  
uri = Uri.parse("content://gmail-ls/messages/email@gmail.com/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" openInputStream适用于mms,但是对于GMail,我收到错误消息:“打开sd卡上的附件,并具有附件的直接路径”

I don't understand what "direct path to the attachment"? 我不明白什么是“附件的直接路径”?

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. 特别是-SDK中没有用于与gmail交互的定义。 Gmail is not part of the SDK. Gmail 属于SDK。 You can't count on this working; 您不能指望这项工作; it is an implementation detail of gmail that can change arbitrarily at any time. 这是gmail的实现细节,可以随时更改。 (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.) (Gmail甚至不是平台的一部分;它基本上只是一些随机的应用程序,碰巧是由Google编写的,您想在其中戳入。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM