当前位置: 代码迷 >> Android >> AndRoid Notification的清空跟修改
  详细解决方案

AndRoid Notification的清空跟修改

热度:47   发布时间:2016-05-01 15:44:55.0
AndRoid Notification的清空和修改

比如一个电话来时,您想要清空通知栏的通知,可用下面的方法

?

public enum Notification { CALL };NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mgr.cancel(Notification.CALL.hashCode());

?

或者您不想清空,而是更改Notification的图标或文字描述,可用下面的方法

?

mgr.notify(Notification.CALL.hashCode(),这里是Notification实例) 

?

应用举例,如删除短信通知,更改连接通知等

1 楼 huangbq 2010-10-25  
找清空通知栏的方法很长时间了,都没很好解决,原来这么简单,多谢fonter!
  相关解决方案