InputMethodManager.SetInputMethodAndSubtype 方法

定义

强制切换到新的输入法和子类型。

[Android.Runtime.Register("setInputMethodAndSubtype", "(Landroid/os/IBinder;Ljava/lang/String;Landroid/view/inputmethod/InputMethodSubtype;)V", "")]
public void SetInputMethodAndSubtype(Android.OS.IBinder token, string? id, Android.Views.InputMethods.InputMethodSubtype? subtype);
[<Android.Runtime.Register("setInputMethodAndSubtype", "(Landroid/os/IBinder;Ljava/lang/String;Landroid/view/inputmethod/InputMethodSubtype;)V", "")>]
member this.SetInputMethodAndSubtype : Android.OS.IBinder * string * Android.Views.InputMethods.InputMethodSubtype -> unit

参数

token
IBinder

提供在启动输入法时提供给输入法的标识令牌,这样它就可以对自身执行此操作。

id
String

要切换到的新输入法的唯一标识符。

subtype
InputMethodSubtype

要切换到的新输入法的新子类型。

属性

注解

强制切换到新的输入法和子类型。 这只能从具有当前活动输入法令牌的应用程序或服务调用。

在 Android Build.VERSION_CODES#Q 和更高版本的设备上, token 甚至不能 null 使用 Manifest.permission#WRITE_SECURE_SETTINGS。 而是直接更新android.provider.Settings.Secure#DEFAULT_INPUT_METHODandroid.provider.Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE和直接更新。

此成员已弃用。 改用 InputMethodService#switchInputMethod(String, InputMethodSubtype)。 此方法适用于应通过服务访问 API 的 IME 开发人员。 此类中的 API 适用于与 IME 交互的应用开发人员。

Java文档android.view.inputmethod.InputMethodManager.setInputMethodAndSubtype(android.os.IBinder, java.lang.String, android.view.inputmethod.InputMethodSubtype)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于