我有一個場景,我需要從我的Android應用程序發送電子郵件。
如何從電子郵件應用程序控制呼叫活動
String to = textTo.getText().toString();
String subject = textSubject.getText().toString();
String message = textMessage.getText().toString();
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{ to});
//email.putExtra(Intent.EXTRA_CC, new String[]{ to});
//email.putExtra(Intent.EXTRA_BCC, new String[]{to});
email.putExtra(Intent.EXTRA_SUBJECT, subject);
email.putExtra(Intent.EXTRA_TEXT, message);
//need this to prompts email client only
email.setType("message/rfc822");
startActivity(Intent.createChooser(email, "Choose an Email client :"));
我用它打開Gmail應用程序上面的代碼,我發送郵件。
但有其中我們可以從我們的應用程序跟蹤就像從郵件是否被髮送,調用活動或片段,這樣我需要讓我的代碼