Android的意图过滤器监听发送电子邮件地址?过滤器、意图、发送电子邮件、地址

由网友(丿指尖中的寂寞)分享简介:我想我的应用程序能够响应时,电子邮件地址是意图发送。例如,当用户点击该联系人应用程序的电子邮件地址,Gmail和电子邮件应用程序显示出来。我想进入该名单。i would like my app to be able to respond when an email address is "sent" in an in...

我想我的应用程序能够响应时,电子邮件地址是意图发送。例如,当用户点击该联系人应用程序的电子邮件地址,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.

什么想法?谢谢?

推荐答案

的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>
阅读全文

相关推荐

最新文章