tags:

views:

22

answers:

1

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

A: 

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

hackbod