Android的意图过滤器监听发送电子邮件地址? [英] android intent-filter to listen for sent email addresses?

查看:156
本文介绍了Android的意图过滤器监听发送电子邮件地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的应用程序能够响应时,电子邮件地址是意图发送。例如,当用户点击该联系人应用程序的电子邮件地址,Gmail和电子邮件应用程序显示出来。我想进入该名单。

i would like my app to be able to respond when an email address is "sent" in an intent. for example, when a user clicks on an email address in the contacts app, the gmail and email apps show up. i'd like to get into that list.

我的第一次尝试是匹配计划=电子邮件地址,

my first attempt was to match on scheme="mailto",

        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="mailto" />
        </intent-filter>

没有工作。下一个尝试是匹配pathPattern = @ 的。

            <data android:pathPattern=".*@.*" />

这没有工作,并作为JD说,这是仅当主机,指定的方案是有意义的。

this didn't work, and as the JD's say, that's only meaningful if the host, scheme is specified.

什么想法?谢谢?

推荐答案

的<一个href="http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=blob_plain;f=AndroidManifest.xml;h=eec7772abe6804a5fb37cd312d2893482c6d8638;hb=HEAD">Email应用程序使用:

<intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <action android:name="android.intent.action.SENDTO"/>
    <data android:scheme="mailto"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
<intent-filter android:label="@string/app_name">
    <action android:name="android.intent.action.SEND"/>
    <data android:mimeType="*/*"/>
    <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter android:label="@string/app_name">
    <action android:name="android.intent.action.SEND_MULTIPLE"/>
    <data android:mimeType="*/*"/>
    <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

这篇关于Android的意图过滤器监听发送电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆