当我尝试发送电子邮件意图时,无论我使用的是 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"));
}