Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the notification after the particular time in 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

like image 207
Krishna Avatar asked Mar 22 '11 23:03

Krishna


People also ask

How do I turn off time notifications on Android?

If i set notification. when = 0 I have time. builder. setWhen(0) removed the time.

How do I remove notifications after click?

You can directly add . setAutoCancel(true) this line into your code in order to remove notification on click.

How do I remove items from my notification bar?

any options you want to remove from the notification bar. Tap on any of the switches to turn them on or off. This removes these options from the notification bar.


1 Answers

The current correct solution may be to use:

NotificationCompat.Builder#setTimeoutAfter(long)

like image 131
David Avatar answered Nov 02 '22 23:11

David