Język

InputMethod.OnUpdateSelection Method

Definition

Called when the application has reported a new selection region of the text.

[Android.Runtime.Register("onUpdateSelection", "(IIIIII)V", "GetOnUpdateSelection_IIIIIIHandler", ApiSince=33)]
public virtual void OnUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd);
[<Android.Runtime.Register("onUpdateSelection", "(IIIIII)V", "GetOnUpdateSelection_IIIIIIHandler", ApiSince=33)>]
abstract member OnUpdateSelection : int * int * int * int * int * int -> unit
override this.OnUpdateSelection : int * int * int * int * int * int -> unit

Parameters

oldSelStart
Int32

The previous text offset of the selection's start.

oldSelEnd
Int32

The previous text offset of the selection's end.

newSelStart
Int32

The new text offset of the selection's start.

newSelEnd
Int32

The new text offset of the selection's end.

candidatesStart
Int32

The text offset where the current composing text starts, or -1 if there is no composing region.

candidatesEnd
Int32

The text offset where the current composing text ends, or -1 if there is no composing region.

Attributes

Remarks

Called when the application has reported a new selection region of the text. This is called whether or not the accessibility service has requested extracted text updates, although if so it will not receive this call if the extracted text has changed as well.

Be careful about changing the text in reaction to this call with methods such as setComposingText, commitText or deleteSurroundingText. If the cursor moves as a result, this method will be called again, which may result in an infinite loop.

Java documentation for android.accessibilityservice.InputMethod.onUpdateSelection(int, int, int, int, int, 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