2016-05-18 68 views

回答

0

您可以使用InputMethodManager.setInputMethodEnabled(String id, boolean enabled)来做你想做的。首先,您需要为键盘找到完整的输入法ID - 很可能您会在dumpsys input_method输出中找到它。 然后你可以使用service call input_method 28 s16 'input.method.name' i32 0做关和service call input_method 28 s16 'input.method.name' i32 1重新启用输入法。

下面的命令已在Android 5.1手机上添加Google Hindi Input

adb shell su 0 service call input_method 28 s16 'com.google.android.apps.inputmethod.hindi/.HindiInputMethodService' i32 1` 

而这个命令已经从启用输入法列表中删除它:

adb shell su 0 service call input_method 28 s16 'com.google.android.apps.inputmethod.hindi/.HindiInputMethodService' i32 0` 
+0

谢谢您的答复。但它不能关闭物理键盘。 – Sorata