Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically change keyboard from custom android keyboard

I have created an android custom keyboard. After pressing a button on it, I'd like it to change the keyboard back to the previous keyboard, presumable using InputMethodManager.setInputMethod(IBinder token, String id);

However, I can't work out where to get the token from - using getCurrentInputBinding().getConnectionToken() doesn't work.

Does anyone know where to find the token?

Thanks,

Ed

like image 933
Ed Jellard Avatar asked Mar 27 '26 01:03

Ed Jellard


1 Answers

Turns out that the switchInputMethod(String id) method works a treat - no need for that token.

like image 116
Ed Jellard Avatar answered Mar 28 '26 16:03

Ed Jellard