我创建一个简单的Android应用程序中创建一个通知。
I am creating an simple android application in that created a notification.
现在我想删除通知,如果用户没有在特定的时间后,响应
Now i want to remove the notification if the user doesn't response after the particular time
这意味着我想经过五分钟删除通知
That means i want remove the notification after five mins
推荐答案您需要的是Alarmmanager和notificationmanger的组合。
What you need is a combination of Alarmmanager and notificationmanger.
注册报警管理器,将在5分钟内调用服务,并在服务实现使用NotificationManager.cancel。
Register the alarm manager that will call a service in 5 minutes and use NotificationManager.cancel in the service implementation.
报警服务示例是此处。我想你知道使用通知管理器。
Alarm Service Sample is here. I suppose you know to use Notification Manager.
更多推荐
如何在Android上的特定时间后删除通知?
发布评论