I've been looking through the NotificationManager
class in the android documentation for API level 10 and haven't found a way to implement this. I also looked around on google but only found how to set the time at which the notification is actually set and how to set the length of time a toast notification widget is displayed.
I have already set the FLAG_NO_CLEAR
and FLAG_ONGOING_EVENT
to keep the notification icon present as well as keep the notification visible after expanding the notification drop-down.
I am attempting to display the text of the notification in the notification bar for 10 seconds instead of the standard amount of time. So I would basically like to do exactly what the setDuration(int)
function does in the toast widget.
I was wondering if this was possible and if so if someone could point me in the right direction on how to accomplish it.
I am attempting to display the text of the notification in the notification bar for 10 seconds instead of the standard amount of time.
If "the text of the notification in the notification bar" means the ticker text (e.g., setTicker()
on your Builder
), you do not control that duration.
If "the text of the notification in the notification bar" means something in the notification drawer entry, you are welcome to cancel()
your notification after a period of time.