I saw numerous answers here about creating an intent filter for a custom file extension, but none of them seem to answer my question:
I have an intent filter that works right now ... when I view a file or open it from an email attachment, my application will appear in the list. The file itself has its own extension "tgtp", but basically it is just an xml file.
The problem I am facing is that although this intent filter works, it also adds my application to every selection item for every type of file on my phone. For example, if I delete the default settings for my contacts and click one of my contacts, it says that my application can open it.
I tried dozens of different combinations of intent filters with different schemes, mime types, etc ... and some still opened the file if I was viewing a file browser, but I need to be able to open email attachments and open as a file browser. I have not yet found an intent filter that allows me to do this without making my application available to all other choices.
Here is my current intent filter, which my application uses to open everything:
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="*/*" /> <data android:pathPattern=".*\\.tgtp" /> </intent-filter>
Thank you in advance
android eclipse email intentfilter
Nick
source share