Język

Html.FromHtml Method

Definition

Overloads

Name Description
FromHtml(String)
Obsolete.

Returns displayable styled text from the provided HTML string with the legacy flags #FROM_HTML_MODE_LEGACY.

FromHtml(String, FromHtmlOptions)

Returns displayable styled text from the provided HTML string.

FromHtml(String, Html+IImageGetter, Html+ITagHandler)
Obsolete.

Returns displayable styled text from the provided HTML string with the legacy flags #FROM_HTML_MODE_LEGACY.

FromHtml(String, FromHtmlOptions, Html+IImageGetter, Html+ITagHandler)

Returns displayable styled text from the provided HTML string with the legacy flags #FROM_HTML_MODE_LEGACY.

FromHtml(String)

Caution

deprecated

Returns displayable styled text from the provided HTML string with the legacy flags #FROM_HTML_MODE_LEGACY.

[Android.Runtime.Register("fromHtml", "(Ljava/lang/String;)Landroid/text/Spanned;", "")]
[System.Obsolete("deprecated")]
public static Android.Text.ISpanned? FromHtml(string? source);
[<Android.Runtime.Register("fromHtml", "(Ljava/lang/String;)Landroid/text/Spanned;", "")>]
[<System.Obsolete("deprecated")>]
static member FromHtml : string -> Android.Text.ISpanned

Parameters

source
String

Returns

Attributes

Remarks

Returns displayable styled text from the provided HTML string with the legacy flags #FROM_HTML_MODE_LEGACY.

This member is deprecated. use #fromHtml(String, int) instead.

Java documentation for android.text.Html.fromHtml(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

FromHtml(String, FromHtmlOptions)

Returns displayable styled text from the provided HTML string.

[Android.Runtime.Register("fromHtml", "(Ljava/lang/String;I)Landroid/text/Spanned;", "", ApiSince=24)]
public static Android.Text.ISpanned? FromHtml(string? source, Android.Text.FromHtmlOptions flags);
[<Android.Runtime.Register("fromHtml", "(Ljava/lang/String;I)Landroid/text/Spanned;", "", ApiSince=24)>]
static member FromHtml : string * Android.Text.FromHtmlOptions -> Android.Text.ISpanned

Parameters

source
String

Returns

Attributes

Remarks

Returns displayable styled text from the provided HTML string. Any &lt;img&gt; tags in the HTML will display as a generic replacement image which your program can then go through and replace with real images.

This uses TagSoup to handle real HTML, including all of the brokenness found in the wild.

Java documentation for android.text.Html.fromHtml(java.lang.String, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

FromHtml(String, Html+IImageGetter, Html+ITagHandler)

Caution

deprecated

Returns displayable styled text from the provided HTML string with the legacy flags #FROM_HTML_MODE_LEGACY.

[Android.Runtime.Register("fromHtml", "(Ljava/lang/String;Landroid/text/Html$ImageGetter;Landroid/text/Html$TagHandler;)Landroid/text/Spanned;", "")]
[System.Obsolete("deprecated")]
public static Android.Text.ISpanned? FromHtml(string? source, Android.Text.Html.IImageGetter? imageGetter, Android.Text.Html.ITagHandler? tagHandler);
[<Android.Runtime.Register("fromHtml", "(Ljava/lang/String;Landroid/text/Html$ImageGetter;Landroid/text/Html$TagHandler;)Landroid/text/Spanned;", "")>]
[<System.Obsolete("deprecated")>]
static member FromHtml : string * Android.Text.Html.IImageGetter * Android.Text.Html.ITagHandler -> Android.Text.ISpanned

Parameters

source
String
imageGetter
Html.IImageGetter
tagHandler
Html.ITagHandler

Returns

Attributes

Remarks

This method was deprecated in API level 24. Use fromHtml(String,int,ImageGetter,TagHandler) instead.

Returns displayable styled text from the provided HTML string with the legacy flags FROM_HTML_MODE_LEGACY.

Android reference for android.text.Html.fromHtml.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

FromHtml(String, FromHtmlOptions, Html+IImageGetter, Html+ITagHandler)

Returns displayable styled text from the provided HTML string with the legacy flags #FROM_HTML_MODE_LEGACY.

[Android.Runtime.Register("fromHtml", "(Ljava/lang/String;ILandroid/text/Html$ImageGetter;Landroid/text/Html$TagHandler;)Landroid/text/Spanned;", "", ApiSince=24)]
public static Android.Text.ISpanned? FromHtml(string? source, Android.Text.FromHtmlOptions flags, Android.Text.Html.IImageGetter? imageGetter, Android.Text.Html.ITagHandler? tagHandler);
[<Android.Runtime.Register("fromHtml", "(Ljava/lang/String;ILandroid/text/Html$ImageGetter;Landroid/text/Html$TagHandler;)Landroid/text/Spanned;", "", ApiSince=24)>]
static member FromHtml : string * Android.Text.FromHtmlOptions * Android.Text.Html.IImageGetter * Android.Text.Html.ITagHandler -> Android.Text.ISpanned

Parameters

source
String
imageGetter
Html.IImageGetter
tagHandler
Html.ITagHandler

Returns

Attributes

Remarks

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).

This uses TagSoup to handle real HTML, including all of the brokenness found in the wild.

Android reference for android.text.Html.fromHtml.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to