Reputation: 111
I have some queries when it comes to notification on android programming. I have read up on the notificationmanager, notification and notificationbuilder but it doesn't seem to allow it to listen for notifications.
What I am trying to do is when a notification is send by any application, I will be able to know the contents of it. Is that actually possible and how can it be done?
Upvotes: 11
Views: 16133
Reputation: 41
To Listen all incoming notifications in android you need to use NotificationListenerService and declare intent in manifest file. so that you can get the (android.permission.BIND_NOTIFICATION_LISTENER_SERVICE) Permission
See this post for better understanding and complete code.
Upvotes: 1
Reputation: 4268
With API level 18 release, there is now a NotificationListenerService. http://developer.android.com/reference/android/service/notification/NotificationListenerService.html
Upvotes: 6
Reputation: 7794
You might want to have a look at
NOTIFICATION TYPES
Notification state changed - represents the event showing Notification.
Type: TYPE_NOTIFICATION_STATE_CHANGED
Properties:
Upvotes: 2
Reputation: 64690
There is currently no generic way to intercept Notifications sent from other applications.
Upvotes: 2