I have been struggling with this for days now.
I am trying to register my activity via intent filter to open a specific custom file type with gmail.
The problem is no matter what I try, either I do not get the option to open the file or any attachment of any file type (including mine) is given the option to open with my application.
I believe the problem is that the URI supplied by gmail doesn't have any file details contained inside it.
There are plenty of people who have asked this same question however the solution to all of them never limit the intent filter to just the custom file type.
The current intent filter in my Android Manifest is the following...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.abc"
android:scheme="content" />
</intent-filter>
Just to reiterate, this intent filter adds the option to open any attachment from gmail with my application.
Any help would be much appreciated
Scroll down to find Gmail and click on it. Scroll down to Advanced settings and click on it. Scroll down to Attachment compliance and hover on it and to see configure option and click on it. Select the messages that you want to affect.
Why can't I see attachments on Gmail? The messages with attachments may be collapsed behind newer messages, so you don't see the attachments, but they do show in the conversation list if you use the Default density and the paperclip icons should be visible in the list.
There is not necessarily a file extension on content://
Uri
values pointing to files. AFAIK, Gmail does not include a file extension on theirs, and so it will not match your pathPattern
. Also, host
is missing the android:
namespace prefix.
If the email will be sent with a distinct MIME type for your file, use that in android:mimeType
and drop the remaining <data>
attributes. If the email will not be sent with a distinct MIME type for your file, then AFAIK you are out of luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With