任何人都可以建议如何在电子邮件正文中添加图像?我试过了,但没有答案。
这是我的代码:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("image/jpeg");
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "gmail@gmail.com" });
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Photo");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + _path));
sendIntent.setType("image/png;text/html");
String htmlecode =
"<html><b>Bold Text works perfectly</b>" +
"<img width='48' height='48' alt='' " +
"src='http://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png' />" +
"</html>";
sendIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(htmlecode, imgGetter, null));
startActivity(Intent.createChooser(sendIntent, "Email:"));
这段代码有什么问题吗?