4

I'm trying to associate my App with my custom file extension.

like here

I did succeed, but now, my App want to open for every files, pdf..., or wathever. My custom files don't have a specific minetype, so i'm trying with different pathPattern combinations but didn't find anything working on Android 4.

<data android:pathPattern=".*\\.custom" />

This worked good on Android 2.3.3, but badly not on v4.

What am i supposed to do, to make it work ? Any tips ? Thanks !

Community
  • 1
  • 1

1 Answers1

1

Ok i finally managed to make it work better, i'm still not fully understanding how the manifest intent filters are supposed to work, but here is what i did:

Intent intercept app showed me the mimetype of my files: "text/plain" so first i did is to add:

 <data android:mimeType="text/plain" >

So, at this point, my App is not showing for every files anymore.

Then, when i'm creating the file, i added: sendIntent.setType("application/custom"); and i added in manifest file the corresponding mimetype.

This way worked good on both Android 2 and 4 phones i tested.

If someone found or wrote something about how intent-filter is exactly working, please let me know !