`
fonter
  • 浏览: 859026 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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!

相关推荐

Global site tag (gtag.js) - Google Analytics