HTML classes are often ignored in the development of Android. This class is simple enough to parse HTML tag text into Normal style text. Let me take a look at the specific description of this class.
Class Structure:
Java.lang.Object |
? |
Android.text.Html |
class overview:
This class is used to process the HTML string and convert it into a text that can be displayed. But not all HTML tags are supported.
Public method:
To say its simplicity is to have four methods for it:
tohtml (spanned text)
< Span style= "font-family: Song body; Color: #222222 "> convert text to html .
Public Methods |
Static String |
escapehtml (charsequence text) Returns the Html escape character from the given representative name. |
Static spanned |
fromhtml (String Source) Returns the text of the style that can be displayed from an Html string. |
Static spanned |
fromhtml (string source, Html.imagegetter imagegetter, Html.taghandler taghandler) Return the displayed style text from html string |
static string | TD valign= "Top" width= "style=" WIDTH:329.85PT; Border-top:none; Border-left:none; Border-bottom:solid White 1.0pt; Border-right:solid White 1.0pt; Background: #E2EFD9; padding:0cm 5.4pt 0cm 5.4pt ">
Method Description:
Public Static spanned fromhtml ( String Source, html.imagegetter imagegetter , html.taghandler taghandler)
Parameters:
source: A string containing HTML.
imagegetter: Imagegetter object. When the system resolves to the tag, it invokes the Getdrawable method of the Imagegetter object and passes the src attribute value to the incoming Getdrawable method. as for the specific meaning of the src attribute, it is determined in the Getdrawable method. The Getdrawable method returns a Drawable object. We can get image resources from res/drawable resources, assets resources, SD cards and the network, and divide into drawable objects.
taghandler: Taghandler object. The Handletag method of the object is called when the system does not process a label. However, this parameter is not commonly used. If not, it can be set to null.
To be Continued ...