Freigeben über


EditorInfo.GetInitialTextBeforeCursor(Int32, Int32) Method

Definition

Get <var>length</var> characters of text before the current cursor position.

public string? GetInitialTextBeforeCursor (int length, int flags);
member this.GetInitialTextBeforeCursor : int * int -> string

Parameters

length
Int32

The expected length of the text.

flags
Int32

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

Returns

the text before the cursor position; the length of the returned text might be less than <var>length</var>. When there is no text before the cursor, an empty string will be returned. It could also be null when the editor or system could not support this protocol.

Remarks

Get <var>length</var> characters of text before the current cursor position. May be null when the protocol is not supported.

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