Android File Associations
Solution 1:
The suggestions in the first answer here helped me: Android intent filter: associate app with file extension
This is my new manifest, for those who may benefit from it:
<intent-filterandroid:icon='@drawable/ic_launcher'android:label='AndroidMHT File'android:priority='1'><actionandroid:name="android.intent.action.VIEW" /><actionandroid:name="android.intent.action.EDIT" /><actionandroid:name="android.intent.action.PICK" /><categoryandroid:name="android.intent.category.DEFAULT" /><categoryandroid:name="android.intent.category.BROWSABLE" /><dataandroid:mimeType="*/*" /><dataandroid:pathPattern="*.mht" /></intent-filter><intent-filter><actionandroid:name="android.intent.action.VIEW" /><categoryandroid:name="android.intent.category.DEFAULT" /><categoryandroid:name="android.intent.category.BROWSABLE" /><dataandroid:scheme="http"android:host="*"android:pathPattern=".*\\.mht" /><dataandroid:scheme="https"android:host="*"android:pathPattern=".*\\.mht" /></intent-filter><intent-filter><actionandroid:name="android.intent.action.VIEW" /><categoryandroid:name="android.intent.category.DEFAULT" /><categoryandroid:name="android.intent.category.BROWSABLE" /><dataandroid:mimeType="message/rfc822"android:scheme="http" /><dataandroid:mimeType="multipart/related"android:scheme="http" /><dataandroid:mimeType="message/rfc822"android:scheme="https" /><dataandroid:mimeType="multipart/related"android:scheme="https" /></intent-filter>
Solution 2:
When retrieving the files from your web site, can you verify what the content types are in the two files? I would expect different behavior if they showed a different type (maybe the web server is interpreting the data and seeing different triggers in each file).
I checked the headers at http://web-sniffer.net/, and the second file doesn't exist anymore so I can't compare.
Another wrinkle that might affect things - unless you set the user agent to match what your Android devices will be using, you might get a different result on your desktop browser or web-sniffer.
Not sure if that's what is causing your problem, but it's worth verifying.
Solution 3:
You can try changing the below attributes
android:mimeType="text/*"android:pathPattern="*.mht"
to your intent-filter
Post a Comment for "Android File Associations"