在浏览器或联系人应用程序中单击电子邮件地址时...
有没有办法让我的应用程序在意图列表中显示邮件客户端?
发布于 2010-10-08 03:27:05
正如您从Mail application's source中看到的,让应用程序捕获意图就像将intent-filter添加到邮件撰写activity定义中的AndroidManifest.xml一样简单。
<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>您可以看到,<data>标记指定用于处理mailto:链接。BROWSABLE类别意味着可以从浏览器启动它。
K-9 Mail类似,不同之处在于仅对DEFAULT类别使用SENDTO操作,对BROWSABLE类别仅使用VIEW操作。
https://stackoverflow.com/questions/3885074
复制相似问题