I am new in Android.
How can I execute some code when new email arrives (gm开发者_开发技巧ail) in Android? Is there a way to do that?
How can I execute some code when new email arrives (gmail) in Android?
There are no documented broadcast Intents
that are sent out when Gmail arrives. Gmail is not part of the Android OS, so it is not part of the Android SDK, and it does not have its own SDK.
for that you have to use Broadcast Receivers
I could get it work on myself with searching some source codes of different programs. But it is really hacky. Since there is no documented broadcast about it, I won't share any code. If anyone interested, can take a look at GmailNotifier source code at github.
GmailNotifier notifies user when receive new GMail.
P.S: And please note that, it is only for GMAIL. Not all email as title says. (A moderator has edited it, idk why.)
精彩评论