On Fri, Jan 28, 2011 at 7:20 AM, hansolo <[email protected]> wrote:
> I'm trying to make an app which is automatically started when user try
> to open a some attached file (which has a custom extension) on mail
> client.

You are much better served using a standard MIME type.

> my logcat show as follow when I try to preview an attached file on
> mail client.
> --------------------
> 01-28 11:55:37.078: INFO/ActivityManager(59): Starting activity:
> Intent { act=android.intent.action.VIEW dat=content://
> com.android.email.attachmentprovider/1/3/RAW flg=0x80001 }

And this is why you need a standard MIME type, as email attachments
have no extension in their content Uri values.

> and I tried following intent filter
> ----------------------
>                        <intent-filter>
>                                <action 
> android:name="android.intent.action.VIEW" />
>                                <category 
> android:name="android.intent.category.DEFAULT" />
>                        </intent-filter>
> ---------------------
>
> but this filter failed to catch that intent.

Of course.

> so, please help me. what filter should I build to catch this intent?

Use a standard MIME type -- one the email client is likely to
understand and use with the attachment. Then, add a <data> element to
your filter with an android:mimeType attribute that is the MIME type
you are using.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://bit.ly/smand1 and http://bit.ly/smand2

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