Android file type user association when clicking on a file

Guys after the battle for google. I am stuck in this problem.

I want to open my application by clicking on a specific type of file (.tap) from email and parse the XML data from the file and show it in the view of my application. I tried it all on the stack, but unfortunately none of them worked.

I tried this king of solutions.

+4
source share
1 answer

Hope it works

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />

<category android:name="android.intent.category.DEFAULT" />
<data
android:host="*"
android:mimeType="application/octet-stream"
android:pathPattern=".*\\.tap" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />

<category android:name="android.intent.category.DEFAULT" />
<data
android:host="*"
android:mimeType="application/tap"
android:pathPattern=".*\\.tap" />
</intent-filter>
+2
source

Source: https://habr.com/ru/post/1612360/


All Articles