7

描述 android 2.2+ 设备要求的图片

我们如何通过超文本标记语言 (HTML) 在默认的 android 电子邮件客户端中获取内联图像?

4

2 回答 2

4

You can not. As default Email application's doesn't support <img /> tag.

Because, ImageSpan doesn't implementing Parcelable.

Hence its failed with Intent's PUT_EXTRA.

Its works only for basic tags, like, <b>, <i> ..etc

Look at Sending html email in android using <table>, etc. - is there really no relatively built-in Intent way? and How to show an image in the email body?

于 2013-02-28T13:16:33.417 回答
1

字符串主体=" <html><body><table>...</table></body></html>";

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body).toString());                    
startActivity(Intent.createChooser(emailIntent, "Email:"));

不幸的是,该<table> ,'img'标签不受支持。受支持的标签实际上更依赖于您用于发送电子邮件的电子邮件客户端 - 其中一些标签比其他标签更挑剔/限制性更强。不过,它们中的大多数都使用诸如等之类的超级基本格式标签<b>, <i>, <h1>,

于 2013-02-28T13:21:04.100 回答