Share via


IInputConnection.DeleteSurroundingTextInCodePoints(Int32, Int32) Method

Definition

A variant of #deleteSurroundingText(int, int).

[Android.Runtime.Register("deleteSurroundingTextInCodePoints", "(II)Z", "GetDeleteSurroundingTextInCodePoints_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public bool DeleteSurroundingTextInCodePoints (int beforeLength, int afterLength);
[<Android.Runtime.Register("deleteSurroundingTextInCodePoints", "(II)Z", "GetDeleteSurroundingTextInCodePoints_IIHandler:Android.Views.InputMethods.IInputConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member DeleteSurroundingTextInCodePoints : int * int -> bool

Parameters

beforeLength
Int32

The number of characters before the cursor to be deleted, in code points. If this is greater than the number of existing characters between the beginning of the text and the cursor, then this method does not fail but deletes all the characters in that range.

afterLength
Int32

The number of characters after the cursor to be deleted, in code points. If this is greater than the number of existing characters between the cursor and the end of the text, then this method does not fail but deletes all the characters in that range.

Returns

true on success, false if the input connection is no longer valid. Before Android android.os.Build.VERSION_CODES#TIRAMISU, this API returned false when the target application does not implement this method.

Attributes

Remarks

A variant of #deleteSurroundingText(int, int). Major differences are:

<ul> <li>The lengths are supplied in code points, not in Java chars or in glyphs.</> <li>This method does nothing if there are one or more invalid surrogate pairs in the requested range.</li> </ul>

<strong>Editor authors:</strong> In addition to the requirement in #deleteSurroundingText(int, int), make sure to do nothing when one ore more invalid surrogate pairs are found in the requested range.

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