我创建了一个Android自定义键盘。按下一个按钮后,我想它将键盘改回到以前的键盘,推测使用InputMethodManager.setInputMethod(IBinder token, String id);
以编程方式更改自定义Android键盘的键盘
但是,我不能找出从哪里得到令牌 - 使用getCurrentInputBinding().getConnectionToken()
不起作用。
有谁知道在哪里可以找到令牌?
感谢,
埃德
我创建了一个Android自定义键盘。按下一个按钮后,我想它将键盘改回到以前的键盘,推测使用InputMethodManager.setInputMethod(IBinder token, String id);
以编程方式更改自定义Android键盘的键盘
但是,我不能找出从哪里得到令牌 - 使用getCurrentInputBinding().getConnectionToken()
不起作用。
有谁知道在哪里可以找到令牌?
感谢,
埃德
原来,switchInputMethod(String id)
方法工作的对待 - 没有必要的令牌。
您从视图中获取标记view.getWindowToken()
。
你在哪里找到这个方法? –
我不记得我在哪里找到它,但它在扩展InputMethodService的类上可用 –
我使用Google搜索得多,但无法成功获取此命名方法。 好吧,它离开它。但请告诉我你已成功将键盘更改为自定义键盘?我有一个关于这个问题的问题,是我想改变键盘的主题,所以只想知道如何通过编程方式做到这一点?有什么想法?喜欢这个https://play.google.com/store/apps/details?id=com.touchtype.swiftkey.phone.trial&feature=more_from_developer#?t=W251bGwsMSwxLDEwMiwiY29tLnRvdWNodHlwZS5zd2lmdGtleS5waG9uZS50cmlhbCJd –