fromhtml

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

时光怂恿深爱的人放手 提交于 2021-01-05 09:10:48
问题 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

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

fromHtml: Different behaviour on JellyBean and KitKat (and above)

与世无争的帅哥 提交于 2019-12-11 06:00:43
问题 I am using fromHtml to display formatted text (bold italic etc) in TextView . However, I found it's behaviour is different on JellyBean (4.1.2) and KitKat(4.4.2) Here is code: String myHtml = "<b>hello</b>😄"; Spanned spanned = Html.fromHtml(myHtml, null, null); Here html string has 😄 which is unicode for an emoji. Now after calling fromHtml it returns following value on KitKat (and above): spanned = hello😄 Here is screenshot of Android Studio for the same: This is expected behaviour as we can