How to add an image in email body How to add an image in email body android android

How to add an image in email body


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

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.


Here is a related question.

It seems that you can use:

intent.putExtra(Intent.EXTRA_STREAM, uri);

where uri is a file path URI.


You have to create an email with HTML body and embedded image: http://www.campaignmonitor.com/blog/post/1761/embedding-images-in-email/

To send email in Android follow this recipe: How to send email in Android ?