【发布时间】:2013-05-11 18:43:53
【问题描述】:
当我尝试发送电子邮件 Intent 时,无论我使用的是 INTENT.ACTION_SEND 还是 ACTION.SENDTO 并使用库存的 Sony Xperia Active 电子邮件客户端,主题和收件人都可以正常显示,但正文是空的,除了标准客户粘贴的评论。在我的三星 Galaxy Note 2 上,同样的代码就像魅力一样。
if(mPrefs.getBoolean("alternative_email_client", false)){
Intent send = new Intent(Intent.ACTION_SENDTO);
String uriText = "mailto:" + Uri.encode(emailStrings[6]) +
"?subject=" + Uri.encode("The subject") +
"&body=" + Uri.encode(emailBody);
Uri uri = Uri.parse(uriText);
send.setData(uri);
startActivity(Intent.createChooser(send, "Email verschicken"));
} else {
Intent send = new Intent(Intent.ACTION_SEND);
send.putExtra(Intent.EXTRA_EMAIL, emailStrings[6]);
send.putExtra(Intent.EXTRA_SUBJECT, "The Subject");
send.putExtra(Intent.EXTRA_TEXT, emailBody);
startActivity(Intent.createChooser(send, "Email verschicken"));
}
【问题讨论】:
标签: android email android-intent