Android notification doesn't disappear after clicking the notifcation

前端 未结 7 693
逝去的感伤
逝去的感伤 2020-12-12 17:48

If got some issues with a notification I want to show in the notification bar. Although I set the notification flag to Notification.DEFAULT_LIGHTS & Notification.F

相关标签:
7条回答
  • 2020-12-12 18:34

    Remove a notification

    Notifications remain visible until one of the following happens:

    1. The user dismisses the notification.
    2. The user clicks the notification, and you called setAutoCancel() when you created the notification.
    3. You call cancel() for a specific notification ID. This method also deletes ongoing notifications.
    4. You call cancelAll(), which removes all of the notifications you previously issued.
    5. If you set a timeout when creating a notification using setTimeoutAfter(), the system cancels the notification after the specified duration elapses. If required, you can cancel a notification before the specified timeout duration elapses.

    For more details see: https://developer.android.com/training/notify-user/build-notification?hl=en

    0 讨论(0)
提交回复
热议问题