I have tried a lot of ways to get an intent filter to detect my custom file 
type and let me open it from gmail with my program, but nothing works 
right, at least on Android 4.1 (cyanogen mod). Unfortunately I cannot test 
it extensively on much else at the moment, but I need it to work on as many 
versions as possible.
This is what I have right now:

            <intent-filter >
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" 
/>
                <data android:scheme="content" android:host="*"
                      android:pathPattern=".*\\.umsg" />
                <data android:scheme="file" android:host="*"
                      android:pathPattern=".*\\.umsg" />
            </intent-filter>
            <intent-filter >
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" 
/>
                <data android:mimeType="*/*" />
                <data android:scheme="content" android:host="*"
                      android:pathPattern=".*\\.umsg" />
                <data android:scheme="file" android:host="*"
                      android:pathPattern=".*\\.umsg" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="application/*" 
android:pathPattern=".*\\.umsg" android:scheme="content" />
            </intent-filter>

Where ".umsg" is a custom binary file. On my device, I can successfully 
open this file type from gmail (View and Save show up on attachments 
containing these files) and from Root Explorer. However, if I receive an 
email and get the gmail notification, clicking it in the notifications 
drawer also asks what to open it with: gmail or my app. This is obviously 
undesirable. The problem does not happen for attachments containing other 
file types. I have tried other extension names as well, with no luck, so 
I'm guessing this is not an extension name conflict.

How can I get this to work on as many Android versions as possible? Someone 
also told me that it does not work on 2.3 (a Galaxy S II). I need it to 
work at least on anything >= 2.3.

Related: 
http://stackoverflow.com/questions/13156212/intent-filter-for-custom-file-type

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