Language

ActionMode.SetTextSelection Method

Definition

Overloads

Name Description
SetTextSelection(ICharSequence, Int32, Int32, LocaleList)

Forward text selection data for ActionMode to process.

SetTextSelection(String, Int32, Int32, LocaleList)

Forward text selection data for ActionMode to process.

SetTextSelection(ICharSequence, Int32, Int32, LocaleList)

Forward text selection data for ActionMode to process.

[Android.Runtime.Register("setTextSelection", "(Ljava/lang/CharSequence;IILandroid/os/LocaleList;)V", "GetSetTextSelection_Ljava_lang_CharSequence_IILandroid_os_LocaleList_Handler", ApiSince=37)]
public virtual void SetTextSelection(Java.Lang.ICharSequence? text, int start, int end, Android.OS.LocaleList locales);
[<Android.Runtime.Register("setTextSelection", "(Ljava/lang/CharSequence;IILandroid/os/LocaleList;)V", "GetSetTextSelection_Ljava_lang_CharSequence_IILandroid_os_LocaleList_Handler", ApiSince=37)>]
abstract member SetTextSelection : Java.Lang.ICharSequence * int * int * Android.OS.LocaleList -> unit
override this.SetTextSelection : Java.Lang.ICharSequence * int * int * Android.OS.LocaleList -> unit

Parameters

text
ICharSequence

The text of the text view. If the text is empty or null, it clears the previous text selection and its action classification results, equivalent to calling clearTextSelection().

start
Int32

The start of the selection. If this parameter is < 0 or > end, it throws an IllegalArgumentException.

end
Int32

The end of the selection. If this parameter is < 0 or < start, it throws an IllegalArgumentException.

locales
LocaleList

The locales of the texts/view/selection. If it is empty, a default/unknown locale will be used.

Attributes

Remarks

Forward text selection data for ActionMode to process. The method is called when text selection changes. An implementation of this API processes the text selection data such as running the text classification task and handles the resulting actions, rendering them in the action bar.

Android reference for android.view.ActionMode.setTextSelection.

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

SetTextSelection(String, Int32, Int32, LocaleList)

Forward text selection data for ActionMode to process.

public void SetTextSelection(string? text, int start, int end, Android.OS.LocaleList locales);
member this.SetTextSelection : string * int * int * Android.OS.LocaleList -> unit

Parameters

text
String

The text of the text view. If the text is empty or null, it clears the previous text selection and its action classification results, equivalent to calling clearTextSelection().

start
Int32

The start of the selection. If this parameter is < 0 or > end, it throws an IllegalArgumentException.

end
Int32

The end of the selection. If this parameter is < 0 or < start, it throws an IllegalArgumentException.

locales
LocaleList

The locales of the texts/view/selection. If it is empty, a default/unknown locale will be used.

Remarks

This string overload creates a Java character sequence for non-null text, forwards the selection bounds and locales to the character-sequence overload, and releases the temporary string wrapper after the call.

Applies to