当我尝试使用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"));
}
API >= 15
,这可能不起作用。因此,请尝试访问:https://dev59.com/4m445IYBdhLWcg3wZJYn - JFreeman