在android中检测传入的电子邮件通知 [英] Detect incoming email notification in android

查看:38
本文介绍了在android中检测传入的电子邮件通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

android 收到邮件时是否可以检测到通知?

有没有我可以尝试的解决方案、教程或示例代码?

is there any solution, tutorial, or sample code I can try?

谢谢

推荐答案

你应该实现一个广播接收器并监听android.intent.action.PROVIDER_CHANGED"意图

you should implement a broadcast receiver and listen to "android.intent.action.PROVIDER_CHANGED" intent

<receiver android:name="GmailReceiver">
        <intent-filter>
            <action android:name="android.intent.action.PROVIDER_CHANGED"
                android:priority="-10">
            </action>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="content" android:host="gmail-ls"
                android:pathPattern="/unread/.*">
            </data>
        </intent-filter>
    </receiver>

这篇关于在android中检测传入的电子邮件通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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