Can we detect a notification when there is incoming email in android ?
is there any solution, tutorial, or sample code I can try?
Thanks
Can we detect a notification when there is incoming email in android ?
is there any solution, tutorial, or sample code I can try?
Thanks
you should implement a broadcast receiver and listen to "android.intent.action.PROVIDER_CHANGED" intent
gor's answer worked (i edited it a bit)!!! thanks.
So add that to your manifest. And here is the receiver class I used to add notification to my app:
You want below api Jelly bean you should use the accessibility service
reffer the following class
accessibility class
I think that you searching for BroadcastReceiver (only if you manage the email by yourself and it is not a third-party email. In this case, probably you can do nothing):
http://www.vogella.com/tutorials/AndroidBroadcastReceiver/article.html
Try to implements NotificationListenerService. here is the official documentation https://developer.android.com/reference/android/service/notification/NotificationListenerService.html
and you can take a look to this question NotificationListenerService Implementation