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