English | Site Directory

Android - An Open Handset Alliance Project

android.text
public class

android.text.Html

java.lang.Object
android.text.Html

This class processes HTML strings into displayable styled text. Not all HTML tags are supported.

Nested Classes
Html.ImageGetter Retrieves images for HTML <img> tags. 
Html.TagHandler Is notified when HTML tags are encountered that the parser does not know how to interpret. 

Summary

Public Methods

      static  Spanned  fromHtml(XmlPullParser xpp, ImageGetter img, TagHandler tagHandler)
Returns displayable styled text from the provided HTML parser.
      static  Spanned  fromHtml(String source, ImageGetter img, TagHandler tagHandler)
Returns displayable styled text from the provided HTML string.
      static  Spanned  fromHtml(String source)
Returns displayable styled text from the provided HTML string.
Methods inherited from class java.lang.Object

Details

Public Methods

public static Spanned fromHtml(XmlPullParser xpp, ImageGetter img, TagHandler tagHandler)

Returns displayable styled text from the provided HTML parser. Any <img> tags in the HTML will use the specified ImageGetter to request a representation of the image (use null if you don't want this) and the specified TagHandler to handle unknown tags (specify null if you don't want this).

public static Spanned fromHtml(String source, ImageGetter img, TagHandler tagHandler)

Returns displayable styled text from the provided HTML string. Any <img> tags in the HTML will use the specified ImageGetter to request a representation of the image (use null if you don't want this) and the specified TagHandler to handle unknown tags (specify null if you don't want this).

public static Spanned fromHtml(String source)

Returns displayable styled text from the provided HTML string. Any <img> tags in the HTML will display as a generic replacement image which your program can then go through and replace with real images.
Build m5-rc15g - 14 May 2008 12:50