1.、NotificationManager 称作通知管理器,是负责通知的管理。
2、
方式来获取notification管理器,或者
3、notificationManager的主要使用方法notifiy和cancel两个方法
3.1: notifiy(int id,Notification) 来更新notification,如果id已经存在,则更新;如果不存在,则新建。
如官网给出的解释
3.2 :cancel(int id) 取消制定id的notification。例如当通知栏上面有个id为1和2的通知,cancel(1)将只会取消id为1的通知栏。
3.3:notify(String tag, int id, Notification notification),将通知栏加入状态栏,标签为tag,标记为id。有相对应的cancel(String tag,int id)
方法。
demo
通知管理器NotificationManager详解
本文深入探讨了Android中NotificationManager的功能与用法,包括如何获取管理器、使用notifiy和cancel方法更新与取消通知,以及通过标签进行通知管理。
1242

被折叠的 条评论
为什么被折叠?



