我使用:Android:使用電子郵件意圖發送電子郵件,可能在發送之前更改消息?
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
來,我需要一些頁腳添加到郵件發送電子郵件,是否有任何監聽器或某種方式當用戶點擊「發送」,我可以編輯短信?
謝謝!
編輯:
下面是我使用的代碼:
private void sendEmail(String recipient, String subject, String message) {
try {
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
if (recipient != null) emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{recipient});
if (subject != null) emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
if (message != null) emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
} catch (ActivityNotFoundException e) {
// cannot send email for some reason
}
}
有沒有像場:
android.content.Intent.EXTRA_EMAIL
這讓我提供信息的意圖。
請看我更新的代碼,謝謝! – hzxu 2011-06-08 05:00:45
@hzxu見上面 – Aleadam 2011-06-08 05:08:48
嗨,我知道你的意思,但我的意思是總是出現在信息的末尾,例如「由ABC iphone客戶端發佈」的頁腳,當你發佈時你看不到它,但它附加在實際的文章中。 – hzxu 2011-06-08 05:13:27