Android 如何拦截状态栏通知?

编程入门 行业动态 更新时间:2024-10-26 02:33:00
本文介绍了Android 如何拦截状态栏通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道我是否可以拦截来自状态栏的通知.这样做的目的是以某种方式拦截传入的 gmail 并用它做一些事情,我真的不需要电子邮件的内容,但它会更好.但是由于 gmail 已经停止了对接收器和数据库的访问,我试图通过监听状态栏来寻找解决方案,如果这可能的话.有什么想法吗?

i would want to know if i can intercept a notification from Status Bar. The purpose of this is to somehow intercept an incoming a gmail and do something with it, i don't really need the content of the email, but it would be nicer. But since gmail had stopped the access to receiver and db, i am trying to find a workaround solution by listen the Status Bar if even this is possible. Any ideas ?

groups.google/a/googleproductforums/forum/#!category-topic/gmail/reading-and-receiving-messages/XD0C4sw9K7U

推荐答案

您可以使用来自 API 18 NotificationListenerService 以获取有关 StatusBarNotifications 的通知.

You can use from API 18 NotificationListenerService to get notified about StatusBarNotifications.

更多推荐

Android 如何拦截状态栏通知?

本文发布于:2023-11-27 12:05:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637999.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:状态栏   通知   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!