Condividi tramite


Linkify.AddLinks Method

Definition

Overloads

AddLinks(ISpannable, Pattern, String, String[], Linkify+IMatchFilter, Linkify+ITransformFilter, IFunction)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(TextView, Pattern, String, String[], Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(ISpannable, Pattern, String, String[], Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(ISpannable, Pattern, String, Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(TextView, Pattern, String, Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(ISpannable, Pattern, String)

Applies a regex to a Spannable turning the matches into links.

AddLinks(ISpannable, MatchOptions, IFunction)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(TextView, MatchOptions)

Scans the text of the provided TextView and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(ISpannable, MatchOptions)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

AddLinks(TextView, Pattern, String)

Applies a regex to the text of a TextView turning the matches into links.

AddLinks(ISpannable, Pattern, String, String[], Linkify+IMatchFilter, Linkify+ITransformFilter, IFunction)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;[Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;Ljava/util/function/Function;)Z", "", ApiSince=29)]
public static bool AddLinks (Android.Text.ISpannable spannable, Java.Util.Regex.Pattern pattern, string? defaultScheme, string[]? schemes, Android.Text.Util.Linkify.IMatchFilter? matchFilter, Android.Text.Util.Linkify.ITransformFilter? transformFilter, Java.Util.Functions.IFunction? urlSpanFactory);
[<Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;[Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;Ljava/util/function/Function;)Z", "", ApiSince=29)>]
static member AddLinks : Android.Text.ISpannable * Java.Util.Regex.Pattern * string * string[] * Android.Text.Util.Linkify.IMatchFilter * Android.Text.Util.Linkify.ITransformFilter * Java.Util.Functions.IFunction -> bool

Parameters

spannable
ISpannable
pattern
Pattern
defaultScheme
String
schemes
String[]
matchFilter
Linkify.IMatchFilter
transformFilter
Linkify.ITransformFilter
urlSpanFactory
IFunction

Returns

True if at least one link is found and applied.

Attributes

Remarks

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, 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

AddLinks(TextView, Pattern, String, String[], Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;Ljava/util/regex/Pattern;Ljava/lang/String;[Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)V", "", ApiSince=24)]
public static void AddLinks (Android.Widget.TextView text, Java.Util.Regex.Pattern pattern, string? defaultScheme, string[]? schemes, Android.Text.Util.Linkify.IMatchFilter? matchFilter, Android.Text.Util.Linkify.ITransformFilter? transformFilter);
[<Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;Ljava/util/regex/Pattern;Ljava/lang/String;[Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)V", "", ApiSince=24)>]
static member AddLinks : Android.Widget.TextView * Java.Util.Regex.Pattern * string * string[] * Android.Text.Util.Linkify.IMatchFilter * Android.Text.Util.Linkify.ITransformFilter -> unit

Parameters

text
TextView

Spannable whose text is to be marked-up with links

pattern
Pattern
defaultScheme
String
schemes
String[]
matchFilter
Linkify.IMatchFilter
transformFilter
Linkify.ITransformFilter
Attributes

Remarks

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, 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

AddLinks(ISpannable, Pattern, String, String[], Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;[Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)Z", "", ApiSince=24)]
public static bool AddLinks (Android.Text.ISpannable spannable, Java.Util.Regex.Pattern pattern, string? defaultScheme, string[]? schemes, Android.Text.Util.Linkify.IMatchFilter? matchFilter, Android.Text.Util.Linkify.ITransformFilter? transformFilter);
[<Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;[Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)Z", "", ApiSince=24)>]
static member AddLinks : Android.Text.ISpannable * Java.Util.Regex.Pattern * string * string[] * Android.Text.Util.Linkify.IMatchFilter * Android.Text.Util.Linkify.ITransformFilter -> bool

Parameters

spannable
ISpannable
pattern
Pattern
defaultScheme
String
schemes
String[]
matchFilter
Linkify.IMatchFilter
transformFilter
Linkify.ITransformFilter

Returns

True if at least one link is found and applied.

Attributes

Remarks

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, 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

AddLinks(ISpannable, Pattern, String, Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)Z", "")]
public static bool AddLinks (Android.Text.ISpannable spannable, Java.Util.Regex.Pattern pattern, string? scheme, Android.Text.Util.Linkify.IMatchFilter? matchFilter, Android.Text.Util.Linkify.ITransformFilter? transformFilter);
[<Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)Z", "")>]
static member AddLinks : Android.Text.ISpannable * Java.Util.Regex.Pattern * string * Android.Text.Util.Linkify.IMatchFilter * Android.Text.Util.Linkify.ITransformFilter -> bool

Parameters

spannable
ISpannable
pattern
Pattern
scheme
String

Url scheme string (eg http:// to be prepended to the url of links that do not have a scheme specified in the link text

matchFilter
Linkify.IMatchFilter

The filter that is used to allow the client code additional control over which pattern matches are to be converted into links.

transformFilter
Linkify.ITransformFilter

Returns

True if at least one link is found and applied.

Attributes

Remarks

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, 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

AddLinks(TextView, Pattern, String, Linkify+IMatchFilter, Linkify+ITransformFilter)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;Ljava/util/regex/Pattern;Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)V", "")]
public static void AddLinks (Android.Widget.TextView text, Java.Util.Regex.Pattern pattern, string? scheme, Android.Text.Util.Linkify.IMatchFilter? matchFilter, Android.Text.Util.Linkify.ITransformFilter? transformFilter);
[<Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;Ljava/util/regex/Pattern;Ljava/lang/String;Landroid/text/util/Linkify$MatchFilter;Landroid/text/util/Linkify$TransformFilter;)V", "")>]
static member AddLinks : Android.Widget.TextView * Java.Util.Regex.Pattern * string * Android.Text.Util.Linkify.IMatchFilter * Android.Text.Util.Linkify.ITransformFilter -> unit

Parameters

text
TextView

Spannable whose text is to be marked-up with links

pattern
Pattern
scheme
String

Url scheme string (eg http:// to be prepended to the url of links that do not have a scheme specified in the link text

matchFilter
Linkify.IMatchFilter

The filter that is used to allow the client code additional control over which pattern matches are to be converted into links.

transformFilter
Linkify.ITransformFilter
Attributes

Remarks

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, 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

AddLinks(ISpannable, Pattern, String)

Applies a regex to a Spannable turning the matches into links.

[Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;)Z", "")]
public static bool AddLinks (Android.Text.ISpannable text, Java.Util.Regex.Pattern pattern, string? scheme);
[<Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;Ljava/util/regex/Pattern;Ljava/lang/String;)Z", "")>]
static member AddLinks : Android.Text.ISpannable * Java.Util.Regex.Pattern * string -> bool

Parameters

text
ISpannable

Spannable whose text is to be marked-up with links

pattern
Pattern

Regex pattern to be used for finding links

scheme
String

URL scheme string (eg http://) to be prepended to the links that do not start with this scheme.

Returns

True if at least one link is found and applied.

Attributes

Remarks

Applies a regex to a Spannable turning the matches into links.

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, java.util.regex.Pattern, 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

AddLinks(ISpannable, MatchOptions, IFunction)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;ILjava/util/function/Function;)Z", "", ApiSince=29)]
public static bool AddLinks (Android.Text.ISpannable text, Android.Text.Util.MatchOptions mask, Java.Util.Functions.IFunction? urlSpanFactory);
[<Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;ILjava/util/function/Function;)Z", "", ApiSince=29)>]
static member AddLinks : Android.Text.ISpannable * Android.Text.Util.MatchOptions * Java.Util.Functions.IFunction -> bool

Parameters

text
ISpannable

Spannable whose text is to be marked-up with links

mask
MatchOptions

mask to define which kinds of links will be searched

urlSpanFactory
IFunction

function used to create URLSpans

Returns

True if at least one link is found and applied.

Attributes

Remarks

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links. If the mask is nonzero, it also removes any existing URLSpans attached to the Spannable, to avoid problems if you call it repeatedly on the same text.

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, int, java.util.function.Function<java.lang.String, android.text.style.URLSpan>).

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

AddLinks(TextView, MatchOptions)

Scans the text of the provided TextView and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;I)Z", "")]
public static bool AddLinks (Android.Widget.TextView text, Android.Text.Util.MatchOptions mask);
[<Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;I)Z", "")>]
static member AddLinks : Android.Widget.TextView * Android.Text.Util.MatchOptions -> bool

Parameters

text
TextView

TextView whose text is to be marked-up with links

mask
MatchOptions

Mask to define which kinds of links will be searched.

Returns

True if at least one link is found and applied.

Attributes

Remarks

Scans the text of the provided TextView and turns all occurrences of the link types indicated in the mask into clickable links. If matches are found the movement method for the TextView is set to LinkMovementMethod.

Java documentation for android.text.util.Linkify.addLinks(android.widget.TextView, 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

AddLinks(ISpannable, MatchOptions)

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links.

[Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;I)Z", "")]
public static bool AddLinks (Android.Text.ISpannable text, Android.Text.Util.MatchOptions mask);
[<Android.Runtime.Register("addLinks", "(Landroid/text/Spannable;I)Z", "")>]
static member AddLinks : Android.Text.ISpannable * Android.Text.Util.MatchOptions -> bool

Parameters

text
ISpannable

Spannable whose text is to be marked-up with links

mask
MatchOptions

Mask to define which kinds of links will be searched.

Returns

True if at least one link is found and applied.

Attributes

Remarks

Scans the text of the provided Spannable and turns all occurrences of the link types indicated in the mask into clickable links. If the mask is nonzero, it also removes any existing URLSpans attached to the Spannable, to avoid problems if you call it repeatedly on the same text.

Java documentation for android.text.util.Linkify.addLinks(android.text.Spannable, 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

AddLinks(TextView, Pattern, String)

Applies a regex to the text of a TextView turning the matches into links.

[Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;Ljava/util/regex/Pattern;Ljava/lang/String;)V", "")]
public static void AddLinks (Android.Widget.TextView text, Java.Util.Regex.Pattern pattern, string? scheme);
[<Android.Runtime.Register("addLinks", "(Landroid/widget/TextView;Ljava/util/regex/Pattern;Ljava/lang/String;)V", "")>]
static member AddLinks : Android.Widget.TextView * Java.Util.Regex.Pattern * string -> unit

Parameters

text
TextView

TextView whose text is to be marked-up with links

pattern
Pattern

Regex pattern to be used for finding links

scheme
String

URL scheme string (eg http://) to be prepended to the links that do not start with this scheme.

Attributes

Remarks

Applies a regex to the text of a TextView turning the matches into links. If links are found then UrlSpans are applied to the link text match areas, and the movement method for the text is changed to LinkMovementMethod.

Java documentation for android.text.util.Linkify.addLinks(android.widget.TextView, java.util.regex.Pattern, 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