我想用我的應用程序在電子郵件中打開音頻附件。目前我的意圖過濾器是這樣的:電子郵件附件的意圖篩選器
<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(很明顯,第三方應用程序有辦法進入)。我找不到應該添加什麼來做這件事,有沒有人有任何想法?
編輯
這裏是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會自動打開,並且不會被設置爲默認值。我沒有選擇...
我肯定知道的唯一的事情是,附件內容提供商不使用的文件名,但一些字母數字代碼,這樣的* .wav過濾器不適合這項工作。應該使用mimetype。 – bigstones 2011-01-10 18:19:51
我已經有``在那裏,有沒有另外一種方法我應該這樣做? – fredley 2011-01-10 18:21:47
不知道...我有這個``for xml,它工作。 (category = default,action = view) – bigstones 2011-01-10 18:44:56