0

I am trying to change the android default keyboard to another soft keyboard that has already installed.

for achieving this task I tried this code,

imeManager.setInputMethod(txtSearch.getWindowToken(), 
            "lk.bhasha.helakuru/.SinhalaSoftKeyboard");

but the keyboard is not changing.

How do I switch the android soft keyboard to another already installed?

Thanks.

Andrej Jurkin
  • 2,216
  • 10
  • 19

1 Answers1

0

For security reasons, it's not possible to change the keyboard programmatically, unless your application is an IME.

From the documentation:

A client application can ask that the system let the user pick a new IME, but can not programmatically switch to one itself. This avoids malicious applications from switching the user to their own IME, which remains running when the user navigates away to another application. An IME, on the other hand, is allowed to programmatically switch the system to another IME, since it already has full control of user input.

Adinia
  • 3,722
  • 5
  • 40
  • 58
  • ok thanks, But I want to know keyboard changing is possible or not? – Praneeth Jayarathna Jul 26 '17 at 13:26
  • As I already stated in my post, the answer depends on the type of your application: normally, **no**, but if it's an IME, **yes** (see this https://stackoverflow.com/a/16729473/469983) – Adinia Jul 26 '17 at 13:44