http://developer.android.com/guide/topics/text/creating-input-method.html#GeneralDesign reads:
Because multiple IMEs may be installed on the device, provide a way for the user to switch to a different IME directly from the input method UI.
Let's assume I have the source of two input methods and can modify it. I want to let the user switch between them quickly and am ready to reserve a button for that. How do I "switch to a different IME directly from the input method UI"?
Switching to the previous input method from the current input method is:
If you want to switch to a particular input method whose ID you know, you may do as the commented-out lines suggest.
EDIT @pRaNaY suggested a single
.getWindow()
in a silent edit (click "edited" below to see the history). I remember that it did not work for Android 2.3; if you consult the docs, you will see that the first call,InputMethodService.getWindow()
returns aDialog
(which is not a subclass ofWindow
), and the second call,Dialog.getWindow()
returns aWindow
. There is noDialog.getAttributes()
, so with a single.getWindow()
it will not even compile.You cannot change the user's currently active IME through code for security reasons, sorry.
However, you can show a system provided dialog to allow the user to select one of the other enabled ones.