How to remove the notification after the particular time in android?

后端 未结 5 2020
余生分开走
余生分开走 2021-01-05 00:19

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

5条回答
  •  忘掉有多难
    2021-01-05 00:38

    What you need is a combination of Alarmmanager and notificationmanger.

    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.

提交回复
热议问题