我想用我的应用打开电子邮件中的音频附件。目前我的意图过滤器是这样的:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="audio/wav" />
<data android:scheme="http" android:host="*" android:pathPattern=".*\\.wav"/>
<data android:scheme="https" android:host="*" android:pathPattern=".*\\.wav"/>
<data android:scheme="content" android:host="*" android:pathPattern=".*\\.wav"/>
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.wav"/>
</intent-filter>
这适用于我想要的一切,除了电子邮件附件。目前,如果我收到一个 wav 文件,我唯一能做的就是预览它,然后用 Winamp 打开它(很明显,第 3 方应用程序可以进入)。我找不到我应该添加什么来做到这一点,有人知道吗?
编辑
以下是 LogCat 对此事的看法。当我单击预览时,我得到
01-10 19:28:52.691: INFO/ActivityManager(109): Starting: Intent { dat=content://gmail-ls/messages/xxxxxxx%40gmail.com/439/attachments/0.1/BEST/false cmp=com.google.android.gm/.ViewAttachmentActivity } from pid 19483
奇怪的是 Winamp 会自动打开,并且没有设置为默认值。我别无选择...