安卓中点击文件时自定义文件类型关联

4

大家好,在遇到问题后,我在Google上苦苦挣扎。我被困在了这个问题上:

我想通过电子邮件点击特定文件类型(.tap)来打开我的应用程序,并解析文件中的xml数据并显示在我的应用程序视图中。我已经尝试过所有关于这个问题的解决方案,但不幸的是,都没有奏效。

我尝试了此类解决方案。


朋友,这是您可以获取特定文件类型的点击意图的唯一方法。请查看此链接:https://dev59.com/1m865IYBdhLWcg3wi_M2,您可以使其正常工作。 - Piyush
谢谢Piyush,但是这些方法对我都没用。 - Ajay patidar
1个回答

2
希望这个能够起作用。
<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>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接