共用方式為


InputMethodManager.InvalidateInput(View) Method

Definition

Gives a hint to the system that the text associated with view is updated by something that is not an input method editor (IME), so that the system can cancel any pending text editing requests from the IME until it receives the new editing context such as surrounding text provided by InputConnection#takeSnapshot().

[Android.Runtime.Register("invalidateInput", "(Landroid/view/View;)V", "", ApiSince=33)]
public void InvalidateInput (Android.Views.View view);
[<Android.Runtime.Register("invalidateInput", "(Landroid/view/View;)V", "", ApiSince=33)>]
member this.InvalidateInput : Android.Views.View -> unit

Parameters

view
View

The view whose text has changed.

Attributes

Remarks

Gives a hint to the system that the text associated with view is updated by something that is not an input method editor (IME), so that the system can cancel any pending text editing requests from the IME until it receives the new editing context such as surrounding text provided by InputConnection#takeSnapshot().

When view does not support InputConnection#takeSnapshot() protocol, calling this method may trigger View#onCreateInputConnection(EditorInfo).

Unlike #restartInput(View), this API does not immediately interact with InputConnection. Instead, the application may later receive InputConnection#takeSnapshot() as needed so that the system can capture new editing context for the IME. For instance, successive invocations of this API can be coerced into a single (or zero) callback of InputConnection#takeSnapshot().

Java documentation for android.view.inputmethod.InputMethodManager.invalidateInput(android.view.View).

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