This is very stange... I experienced the same problems that you for
some days, and now after comlaining and submitting a bug, it suddently
works without any changes to my code. In my case, I setup a
IntentFilter for some Mime Types, and opened an attached VCF-File in
the Email App with the "Open" Button. It starts my activity in this
way:

Starting activity: Intent { action=android.intent.action.VIEW
data=content://com.android.email.attachmentprovider/f70bd905-0a85-4355-
a56f-a41ef6e20100.db/222/RAW flags=0x1 comp={com.companyname/
com.companyname.ActivityName} }

So everything is fine with the "Email" app. Even the Mime type is
somehow getting through (that is, I think so, because how else would
Android know to delegate this Intent to my app?)

But I still experience the same problems with the Gmail App. It
supplies a "Preview" button and a click starts a download but yields
"The attachment could not ne fetched because this type of file cannot
be displayed on the phone." Maybe I need to adjust my IntentFilter to
handle the file:// protocol, I'll try that and report about it.


On 20 Aug., 17:28, "brian.schimmel" <[email protected]>
wrote:
> This is very annoying, so I just submitted a bug/issue 
> athttp://code.google.com/p/android/issues/detail?id=3611
>
> You can go there and "star" the issue to get notified on updates.
>
> I also looked into the source of theEmailapp. It's completely
> incredible how many layers of indirection are involved after clicking
> on the "download" button (which will not even be visible if the media
> type is not supported) or the "preview" button. It finally ends up in
> com.android.email.activity.MessageView.Listener.loadAttachmentFinished
> (Account, Message, Part, Object) and if this is NOT a "download", then
> this code will be executed (at least I think so, I currently can't
> debug it):
>
>                     Uri uri = AttachmentProvider.getAttachmentUri(
>                             mAccount,
>                             attachment.part.getAttachmentId());
>                     Intent intent = new Intent(Intent.ACTION_VIEW);
>                     intent.setData(uri);
>                     intent.addFlags
> (Intent.FLAG_GRANT_READ_URI_PERMISSION);
>                     startActivity(intent);
>
> As you can see, there is no intent.setType(), so any IntentFilter that
> filters by type will not receive this intent.
>
> On 16 Aug., 08:20, Nivek <[email protected]> wrote:
>
> > Any idea about how to get the real name of the attached file ?
>
> > Nivek
>
> > On 10 juil, 19:13, Alexey Krasnoriadtsev <[email protected]>
> > wrote:
>
> > > You are correct that you should use contentResolver.openInputStream
> > > (uri), to get the data fromgmailattachments.
>
> > > DefaultEmailapp, is very dumb and is hardcoded to only open audio
> > > and imageattachments.
> > > (disclaimer, that was the case 6 month ago, the last time i looked at
> > > it).
>
> > > On Jul 8, 10:16 am, Mirko Nasato <[email protected]> wrote:
>
> > > > Hi all,
>
> > > > I've written an app that can handle the VIEW action for a given
> > > > mimeType, say "application/foo". By adding the following to
> > > > AndroidManifest.xml the Browser automatically uses my app to open
> > > > downloads of that type:
>
> > > >   <intent-filter>
> > > >      <action android:name="android.intent.action.VIEW"/>
> > > >      <category android:name="android.intent.category.DEFAULT"/>
> > > >      <data android:mimeType="application/foo"/>
> > > >   </intent-filter>
>
> > > > TheGMailapp also tries to use my app to Previewattachmentsof that
> > > > type, but it's passing a URI with scheme "gmail-ls://" rather than a
> > > > "file://" URI. I guess I need to use a ContentProvider to get the
> > > > attachment data, I haven't looked into that yet.
>
> > > > But the real mystery is theEmailapp... there just doesn't seem any
> > > > way to make it open theattachments.
>
> > > > Any pointers? Openingattachmentsis a very common requirement of
> > > > course, and I would expect the Android platform to encourage
> > > > developers to write apps to handle more mime types. Instead I couldn't
> > > > find any answers:
>
> > > >  http://groups.google.com/group/android-developers/browse_thread/threa...
> > > >  http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > > > Thanks
>
> > > > Mirko
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to