This question already has an answer here:
- Detect a new Android notification 2 answers
I want to read/access/log the notifications fired on notification bar by other applications.
I searched Intents
and PendingIntents
a lot, but couldn't get a solution.
Does my application need to be notified when any notification is fired?
Or Does android system provide something to read notifications by the user-level applications?
A
Notification
is raised by sending anIntent
.The
NotificationReceiver
catches theIntent
and pops up aNotification
.It is perfectly possible to catch the same
Intent
in one of your applications using a BroadCastReceiver and filter on theIntent
you want.There is not any API for access any notification. At least it would be hole in security. Only thing you can is catching some events, that causes notifications (like sms).
Starting with api 18 (android 4.3) it's possible: http://developer.android.com/reference/android/service/notification/NotificationListenerService.html
Very easy to use, but the user have to give permission to the app manually.
Finally got the answer.!!! Using AccessibilityService
And my Manifest is:
Enjoy Coding.!!! :)