开发者

App not opening attachments in Android Email App

My app is working correctly with Gmail: on clicking preview for an attachment it will open with my app, but not in the Email app. What do I need to add to my manifest to integrate with the email app? Here's my current intent filter:

    <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:mimeType="audio/x-wav" />
         <data and开发者_如何学运维roid:mimeType="audio/ogg" />
    </intent-filter>


I tried opening a .wav attachment in the email app and saw the following line in logcat:

I/ActivityManager(  792): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.email.attachmentprovider/1/2/
RAW flg=0x80001 cmp=com.android.music/.MediaPlaybackActivity }

The intent resolved to MediaPlaybackActivity, part of the stock app... a quick search through the source code located the manifest file which showed how it's capturing content URIs:

<activity android:name="com.android.music.MediaPlaybackActivity"
    ... >
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            ...
            <data android:scheme="content"/>  
            ...
        </intent-filter>
        ...
    </activity>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜