次の方法で共有


EditorInfo.GetInitialTextBeforeCursorFormatted(Int32, Int32) Method

Definition

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

[Android.Runtime.Register("getInitialTextBeforeCursor", "(II)Ljava/lang/CharSequence;", "GetGetInitialTextBeforeCursor_IIHandler", ApiSince=30)]
public virtual Java.Lang.ICharSequence? GetInitialTextBeforeCursorFormatted (int length, int flags);
[<Android.Runtime.Register("getInitialTextBeforeCursor", "(II)Ljava/lang/CharSequence;", "GetGetInitialTextBeforeCursor_IIHandler", ApiSince=30)>]
abstract member GetInitialTextBeforeCursorFormatted : int * int -> Java.Lang.ICharSequence
override this.GetInitialTextBeforeCursorFormatted : int * int -> Java.Lang.ICharSequence

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.

Attributes

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