TextLinks.Apply(ISpannable, ApplyStrategy, IFunction) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Annotates the given text with the generated links.
[Android.Runtime.Register("apply", "(Landroid/text/Spannable;ILjava/util/function/Function;)I", "", ApiSince=28)]
public Android.Views.TextClassifiers.ApplyStatusCode Apply (Android.Text.ISpannable text, Android.Views.TextClassifiers.ApplyStrategy applyStrategy, Java.Util.Functions.IFunction? spanFactory);
[<Android.Runtime.Register("apply", "(Landroid/text/Spannable;ILjava/util/function/Function;)I", "", ApiSince=28)>]
member this.Apply : Android.Text.ISpannable * Android.Views.TextClassifiers.ApplyStrategy * Java.Util.Functions.IFunction -> Android.Views.TextClassifiers.ApplyStatusCode
Parameters
- text
- ISpannable
the text to apply the links to. Must match the original text
- applyStrategy
- ApplyStrategy
the apply strategy used to determine how to apply links to text.
e.g TextLinks#APPLY_STRATEGY_IGNORE
- spanFactory
- IFunction
a custom span factory for converting TextLinks to TextLinkSpans.
Set to null
to use the default span factory.
Returns
a status code indicating whether or not the links were successfully applied
e.g. #STATUS_LINKS_APPLIED
- Attributes
Remarks
Annotates the given text with the generated links. It will fail if the provided text doesn't match the original text used to create the TextLinks.
<strong>NOTE: </strong>It may be necessary to set a LinkMovementMethod on the TextView widget to properly handle links. See TextView#setMovementMethod(MovementMethod)
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.