简体   繁体   中英

Difference between 2 URI

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@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"

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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