Share via


InputMethodManager.SetInputMethodAndSubtype Method

Definition

Force switch to a new input method and subtype.

[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

Parameters

token
IBinder

Supplies the identifying token given to an input method when it was started, which allows it to perform this operation on itself.

id
String

The unique identifier for the new input method to be switched to.

subtype
InputMethodSubtype

The new subtype of the new input method to be switched to.

Attributes

Remarks

Force switch to a new input method and subtype. This can only be called from an application or a service which has a token of the currently active input method.

On Android Build.VERSION_CODES#Q and later devices, token cannot be null even with Manifest.permission#WRITE_SECURE_SETTINGS. Instead, update android.provider.Settings.Secure#DEFAULT_INPUT_METHOD and android.provider.Settings.Secure#SELECTED_INPUT_METHOD_SUBTYPE directly.

This member is deprecated. Use InputMethodService#switchInputMethod(String, InputMethodSubtype) instead. This method was intended for IME developers who should be accessing APIs through the service. APIs in this class are intended for app developers interacting with the IME.

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

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