--ADVERTISEMENT--

Android TextView is one of the powerful and popular UI components which is used to display texts in android application. TextView also allows us to display HTML string. So in this tutorial, you will learn to display html string inside android text view and make text of different style like heading, paragraph, lists, text style, text size, text color etc.

Displaying HTML text in android TextView is very easy. There are many ways to show html string in android textview and in this example, I will show one of the best and easy ways to display HTML string in android app.

Following example shows how to display HTML date string in android using TextView component.

Related:
How to Make Multiple Styles Inside Android TextView
How to Make Android TextView Text Selectable
Create Scrolling Text (Marquee) in Android TextView


Android Example: How to Display/Show HTML String in Android TextView


Following are the code of java file and xml layout file.

XML Layout File

res/layout/ display_html_string_in_textview.xml

Java Activity File


src/ DisplayHtmlStringAndroidTextView.java

Strings.xml File


res/values/strings.xml

 Android Example: How to Display/Show HTML String in Android TextView

Now, run your How to Display/Show HTML String in Android TextView application, you will see HTML paragraph, Headline H1, H3, list item, etc.

Post a Comment

Powered by Blogger.