[英]Click notification action button programmatically
How can I click a notification action button programmatically (another application notif, not my)?如何以编程方式单击通知操作按钮(另一个应用程序通知,而不是我的)? I can click a normal button by using the button.performClick() method.
我可以使用 button.performClick() 方法单击普通按钮。 I have accessibility service to listen to incoming notification (and Notification Service listener to android 5.0+), So,there is any way to do that?
我有可访问性服务来监听传入的通知(以及 android 5.0+ 的通知服务监听器),那么,有什么办法可以做到吗?
For example, click Turn on battery saver or share/delete pragmatically例如,单击“打开省电模式”或“实用地共享/删除”
You need to handle this via Accessibility Service
or NotificationListenerService
您需要通过
Accessibility Service
或NotificationListenerService
处理此问题
after that when you get Notification
class, you can do it by this function:之后,当您获得
Notification
类时,您可以通过此功能来完成:
sbn.notification.actions[0].actionIntent.send()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.