且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在电子邮件正文中添加图像

更新时间:2022-12-03 09:37:04

不幸的是,Intent不可能这样做。

Unfortunately, it's not possible to do this with Intents.

例如,粗体文本显示在EditText而不是图像中的原因是 StyleSplan 正在实现 ImageSpan 则不包含/os/Parcelable.html\">Parcelable 。所以当在新的Activity中检索到Intent.EXTRA_TEXT时,ImageSpan将无法解开,因此不会成为EditText附加的样式的一部分。

The reason why for example bold text is displayed in the EditText and not an Image is that StyleSplan is implementing Parcelable whereas ImageSpan does not. So when the Intent.EXTRA_TEXT is retrieved in the new Activity the ImageSpan will fail to unparcel and therefor not be part of the style appended to the EditText.

使用其他方法您不会通过意图传递数据,不幸的是,由于您无法控制接收活动,因此不可能。

Using other methods where you don't pass the data with the Intent is unfortunately not possible here as you're not in control of the receiving Activity.