views:

149

answers:

1

This has been asked many times, but no working answer was given. I have a custom file type/extension that I want to associate my app with.

As far as I know, the data element is made for this purpose, but I can't get it working. http://developer.android.com/guide/topics/manifest/data-element.html According to the docs, and a lot of forum posts, it should work like this:

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:mimeType="application/pdf" />
</intent-filter>

Well, it does not work. What did I do wrong? And please note that this is the simple version, of what I want to do, I want to declare my own file type.

+1  A: 

Try adding

<action android:name="android.intent.action.VIEW"/>
magaio
Now that works with factory set file types like application/pdf, how would I declare my own file type? And when I say file type, I mean mimeType ;)
Tamas
What kind of file do you want this mimetype to catch? Also, is this file opened from the browser or file manager or sent from another application you made?
magaio
could be from the browser, mail client, file manager, or anywhere..Or my own app ofc :)file extension is custom, specified by client.
Tamas
Well, I'm still stuck...could anybody help please?
Tamas