How do I print text with HTML grammar in a text view?

Asked 1 years ago, Updated 1 years ago, 100 views

<h2>Title</h2><br>
<p>description here</p>

I want to apply this code to the text view and print it out, what should I do?

html android android-textview

2022-09-21 20:04

1 Answers

Html.Write fromHtml()!

myTextView.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>"));

You can use it like this!


2022-09-21 20:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.