Språk

InputConnectionWrapper.GetSurroundingText(Int32, Int32, Int32) Method

Definition

Gets the surrounding text around the current cursor, with beforeLength characters of text before the cursor (start of the selection), afterLength characters of text after the cursor (end of the selection), and all of the selected text.

[Android.Runtime.Register("getSurroundingText", "(III)Landroid/view/inputmethod/SurroundingText;", "GetGetSurroundingText_IIIHandler", ApiSince=31)]
public virtual Android.Views.InputMethods.SurroundingText? GetSurroundingText(int beforeLength, int afterLength, int flags);
[<Android.Runtime.Register("getSurroundingText", "(III)Landroid/view/inputmethod/SurroundingText;", "GetGetSurroundingText_IIIHandler", ApiSince=31)>]
abstract member GetSurroundingText : int * int * int -> Android.Views.InputMethods.SurroundingText
override this.GetSurroundingText : int * int * int -> Android.Views.InputMethods.SurroundingText

Parameters

beforeLength
Int32

The expected length of the text before the cursor. Value is 0 or greater

afterLength
Int32

The expected length of the text after the cursor. Value is 0 or greater

flags
Int32

Supplies additional options controlling how the text is returned. May be either 0 or InputConnection.GET_TEXT_WITH_STYLES. Value is either 0 or InputConnection.GET_TEXT_WITH_STYLES

Returns

Implements

Attributes

Remarks

Gets the surrounding text around the current cursor, with beforeLength characters of text before the cursor (start of the selection), afterLength characters of text after the cursor (end of the selection), and all of the selected text. The range are for java characters, not glyphs that can be multiple characters.

Java documentation for android.view.inputmethod.InputConnectionWrapper.getSurroundingText(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