在我的应用程序中,我可以选择通过电子邮件发送文件的 url,它在除 nexus 7 之外的所有设备(仅限操作系统版本 4.2.2)中都能正常工作。当来自nexus 7的邮件时,收件人只收到一个文本。我搜索了很多解决方案,但找不到任何解决方案。下面是我的代码
public static boolean sendEmailLink(Context context, String[] emailTo, String[] emailCC, String[] emailBCC, String subject, String emailBody, String notification) throws ActivityNotFoundException {
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("message/rfc822");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, emailTo);
emailIntent.putExtra(android.content.Intent.EXTRA_CC, emailCC);
emailIntent.putExtra(android.content.Intent.EXTRA_BCC, emailBCC);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(emailBody));
context.startActivity(Intent.createChooser(emailIntent, notification));
return true;
}