I have an app that sends files with custom file extensions via email that are essentially just encrypted xml files. My app has an intent filter to open these, and it works on my particular phone (Samsung Galazy S Mesmerize), but when I try to open an attachment with my custom file extension on some other phones (Electrify, Thunderbolt, etc) it says there isn’t anything that can open that file. (BTW the phones that are trying DO have my app installed).
Here is my intent-filter:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.tgtp" />
<data android:host="*" />
</intent-filter>
Is there anything I can do to ensure that all android phones will be able to open my custom file extension when they have my app installed?
Thanks
I guess it depends on the path the files are located at on your other devices. I found that the
pathPatternattribute in the intent filter is very sensitive to the full path of the file.Take a look at the following answer for a similar question:
https://stackoverflow.com/a/7102838/624109
Basically, you need to have several
pathPatternattributes that will most likely capture the location of your file.Another thing is that I think that even if you use local files, you still need to have the
portattribute.These two changes are what made it work for me after hours of digging around.