'Is it possible to close the notification panel programmatically in android?
I want the notification panel to automatically collapse when the user presses a notification button.
I tried the answers here but they didn't work. How can I programmatically open/close notifications in Android?
Only answer that comes close is this accessibility method:
performGlobalAction(GLOBAL_ACTION_NOTIFICATIONS);
However this only seems to open the notification panel not close it.
Solution 1:[1]
So, I actually don't know how to do it, but there is a attention from Android docs, that Intent.ACTION_CLOSE_SYSTEM_DIALOGS is deprecated now for API LEVEL>=31 for more security. You can see it here.. And, probably, now we just don't have any way to hide notification bar. Also you can see this StackOverFlow page with same question (there you can find actual answers. Last answer was in March of 2022)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ХолодТема |
