我有一个后台服务在运行以获取数据。我检查新数据并发送状态栏通知。发送通知是服务的一部分。当用户看到该通知时,他登录到应用程序并接受它。这一次我想把它从状态栏中删除。我可以这样做吗?
发布于 2012-08-30 17:51:29
if (Context.NOTIFICATION_SERVICE!=null) {
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager nMgr = (NotificationManager) getApplicationContext().getSystemService(ns);
nMgr.cancel(0);
}在第二个类中编写上述代码,并使用id 0在第一个类中创建通知。
https://stackoverflow.com/questions/7894152
复制相似问题