【发布时间】:2014-05-13 10:45:12
【问题描述】:
我希望通过我的应用打开自定义扩展文件 (*.xyz)。在应用程序清单文件中,我正在编写以下内容:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http" android:host="*" android:pathPattern=".*\\.xyz" />
<data android:scheme="https" android:host="*" android:pathPattern=".*\\.xyz" />
<data android:scheme="content" android:host="*" android:pathPattern=".*\\.xyz" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.xyz" />
</intent-filter>
之后,我将在设备上安装我的应用程序,并发送一封包含Sample.xyz 邮件作为附件的邮件。当我尝试在邮件客户端中点击附件以打开附件时,它会给出一个名为
No app can open this attachment for viewing
即使我下载附件然后尝试打开它也会报错
Can't open file
谁能建议可能出了什么问题?
【问题讨论】:
-
尝试先添加另一个类别:
-
你可以试试这个:
<data android:scheme="content" android:host="*" android:mimeType="application/xyz" />? -
@ManishMulimani android:mimeType="application/xyz" 是做什么的?
标签: android android-intent intentfilter file-type