Is it possible to intercept outgoing emails from Android? I have tried with content provider by using ContentObserver but still no luck.
this is my code.
开发者_StackOverflow final String AUTHORITY_PLUS_MESSAGES = "content://gmail-ls/messages/";
String[] gmailAccounts = getGmailAccount(this.getApplicationContext());
String firstEmailAddress = gmailAccounts[0];
Handler handler = new Handler();
ContentResolver resolver = getContentResolver();
ContentObserver observer = new GmailObserver(handler, resolver, firstEmailAddress);
Uri uri = Uri.parse(AUTHORITY_PLUS_MESSAGES + firstEmailAddress + "/");
resolver.registerContentObserver(uri, Boolean.TRUE, observer);
class GmailObserver extends ContentObserver {
public void onChange(final boolean bSelfChange) {
super.onChange(bSelfChange);
Log.d(TAG, "***** onChange");
// here I am getting lots of calls but not sure how to deal with outgoing messages ..
}
}
Is it possible to intercept outgoing emails from Android?
No, sorry.
精彩评论