Html.fromHtml not working with bold text in body while share intent in email

梦想与她 提交于 2021-01-05 09:09:26

问题


String mailContent = "<b>boldText:</b>"

I tried below also but not working.

String mailContent = "<strong>boldText:</strong>"

Email intent.

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("text/html");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, 
getResources().getString(R.string.slide3_text1));
sendIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(mailContent));
startActivity(Intent.createChooser(sendIntent, "Send Mail"));

Please check this code not showing bold text in mail. i want to display like below.

Title of Content:

Name

etc...

Title of Content 2:

Name

etc.

Please take look into this and let me know I read many blogs. Thanks in advance.


回答1:


As per R&D, I found that this is not possible in new Gmail because Gmail introduces own editor in the mail. Thanks




回答2:


You can use Constant Value: "android.intent.extra.HTML_TEXT" along with EXTRA_TEXT



来源:https://stackoverflow.com/questions/53113165/html-fromhtml-not-working-with-bold-text-in-body-while-share-intent-in-email

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!