我正在使用一些家庭替代品,它允许我隐藏通知栏,这是我真正喜欢的东西。
所有信息都可以用一些小部件替换,但我也想显示通知。
由于我已经开发了一些应用程序,我想知道是否有一个命令行允许应用程序获取所有通知。我计划将其添加到小部件或吐司中。
非常感谢任何线索或帮助。
I am using some home replacement that allow me to hide the notification Bar and that's something I really like.
All the informations can be replaced by some widgets, but I would like to display the notifications too.
As I already developed some applications, I would like to know if there is a command line that allow an application to get all the notifications. I plan to add this to a widget or a toast.
Thank a lot for any clue or help.
发布评论
评论(2)
从 Android API Level 18 (Android 4.3) 开始,有一个类 NotificationListenerService。
您必须设置权限BIND_NOTIFICATION_LISTENER_SERVICE,并将意图过滤器与操作NotificationListenerService结合使用。
来源:http://developer.android.com/reference/android/服务/通知/NotificationListenerService.html#getActiveNotifications()
Since Android API Level 18 (Android 4.3) there is a class NotificationListenerService.
You must set the Permission BIND_NOTIFICATION_LISTENER_SERVICE and use a intent-filter with the action NotificationListenerService.
Source: http://developer.android.com/reference/android/service/notification/NotificationListenerService.html#getActiveNotifications()
我会回答我的问题,因为我在其他论坛上找到了一些东西。
似乎您可以访问它们,将您的应用程序声明为(对不起,法语术语,我找不到英文翻译)“gestionnaire d'accessibilité”,您可以将其翻译为“可访问性管理器”
更多信息:https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent。 html
这可能很危险并且有很多负面影响,但是另一位也在开发自定义主页的开发人员向我保证此功能有效,并且他能够创建自己的通知栏。
I will answer my question because I found something on an other forum.
Seem that you can access them declaring your application as an (sorry for the french term, I couldn't find an english translation) "gestionnaire d'accessibilité" that you may translate as "accessibility manager"
More information here: https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html
That may be dangerous and has a lot of negative point, but an other dev that is also working on a custom Home assure me that this feature work and he was able to create his own notification bar.