I don't think you can use the old value of the keyboard state like this. The state object also contains the text in the text field. If the user typed anything before switching keyboards, that value has changed. And if we pass the old value again, word suggestions will be incorrect until  you hide the keyboard and show it again.

Basically, I just don't think you can make it work right like this.  Please ignore my other comment about just calling deactivate() on the old input method and then calling activate() on the new one. That won't work either.

If we assume that all keyboards use the latin input method, then we can fix this. But rather than having activate() and disableAutoCorrection(), I think you should just add a setLanguage() method on the input method.  Then, when the user switches keyboards, if the new keyboard has the same input method as the old one, and if it has a setLanguage() function, just call it with the new language.  Does that sound like it would work?