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

Asked 2 years ago, Updated 2 years ago, 111 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.