How to clear all notifications programatically

2,513 views
Skip to first unread message

tilljo...@gmail.com

unread,
Jan 31, 2017, 5:28:06 PM1/31/17
to Automate
There is a "clear" button at the bottom of the notifications (pull-down) screen. How do I press this programmatically so to speak?

In the flow the fibre works to the point of allowing the user to select an app in a notification. The app opens, but remains hidden by the notifications screen.

Henrik "The Developer" Lindqvist

unread,
Jan 31, 2017, 8:32:56 PM1/31/17
to Automate, tilljo...@gmail.com
Not possible, except maybe using the Interact block.
A better option is to collect the ids of all posted notification using Notification posted block, then use the Notification action block to cancel them all.

Jonathan Till

unread,
Feb 3, 2017, 1:26:15 AM2/3/17
to Automate
Managed to solve it simply by adding a "send broadcast" block with the action: android.intent.action.CLOSE_SYSTEM_DIALOGS

Got the solution here: http://stackoverflow.com/questions/18261969/clicking-android-notification-actions-does-not-close-notification-drawer/21783203

Henrik "The Developer" Lindqvist

unread,
Feb 3, 2017, 2:16:11 AM2/3/17
to Automate
That will only close the expanded notification panel, it won't "clear" any notifications.

Jonathan Till

unread,
Feb 3, 2017, 3:51:26 AM2/3/17
to Automate
That's what the "clear" button does - maybe not good of android to use this name for the button!

Henrik "The Developer" Lindqvist

unread,
Feb 3, 2017, 3:21:24 PM2/3/17
to Automate
Not so, the "clear all" button will cancel all notifications. "Closing system dialogs" will simply hide the expanded notification panel.

Tariq Hussain

unread,
Dec 17, 2021, 7:40:06 AM12/17/21
to Automate
it is also not working in android 12 do you know any other way to do the same thing

Henrik "The Developer" Lindqvist

unread,
Dec 17, 2021, 2:28:13 PM12/17/21
to Automate
What is not working, clearing all notifications or hiding/collapsing the notification panel?
Reply all
Reply to author
Forward
0 new messages