我有一个 html 将图像显示为 base64 :
<html><body>hello<br/><img style='display:block; width:100px;height:50px;' id='base64image' src='data:image/png;base64,<!-base 64 string-->' /></body></html>
结果是这样的:
但是当我像这样在电子邮件中使用它时:
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{to});
email.putExtra(Intent.EXTRA_SUBJECT, subject);
email.setType("text/html");
String body = new String("<html><body>hello<br/><img style='display:block; width:100px;height:50px;' id='base64image' src='data:image/png;base64,<!-base 64 string-->' /></body></html>");
email.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body));
startActivity(Intent.createChooser(email,"Choose an Email client :"));
结果如下:
图像不显示在邮件中。有什么我在这里想念的吗?传递base64数据是否有任何限制或其他问题?