语言

InputConnectionWrapper.TakeSnapshot 方法

定义

当系统需要以原子方式拍摄多个文本相关数据的快照时,由系统调用。

[Android.Runtime.Register("takeSnapshot", "()Landroid/view/inputmethod/TextSnapshot;", "GetTakeSnapshotHandler", ApiSince=34)]
public virtual Android.Views.InputMethods.TextSnapshot? TakeSnapshot();
[<Android.Runtime.Register("takeSnapshot", "()Landroid/view/inputmethod/TextSnapshot;", "GetTakeSnapshotHandler", ApiSince=34)>]
abstract member TakeSnapshot : unit -> Android.Views.InputMethods.TextSnapshot
override this.TakeSnapshot : unit -> Android.Views.InputMethods.TextSnapshot

返回

null 如果 TextSnapshot 不可用,并且/或此 API 是从 IME 调用的。 请注意上述旧设备中的 bug。

实现

特性

注解

当系统需要以原子方式拍摄多个文本相关数据的快照时,由系统调用。

编辑作者:强烈建议支持此方法。 TextSnapshot以安全、确定的方式优化 IPC 时,以原子方式对系统非常有用。 如果以原子方式获取null的不可用,则返回TextSnapshot。 系统继续正常地支持此类方案。

IME 作者:当前 IME 无法直接调用此方法,并且始终会作为结果接收 null 。

请注意,此方法没有重写的 InputConnectionWrapperbug,即使包装null实现此方法,此方法最终也会在调用时始终返回InputConnection。 bug 已修复。android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE

Java文档android.view.inputmethod.InputConnectionWrapper.takeSnapshot()。

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于