1
我实现一个自定义键盘遵循本指南的INPUTMETHOD(自定义键盘)的应用:http://developer.android.com/guide/topics/text/creating-input-method.htmlAndroid的 - 确定调用
有没有从我的KeyboardService的应用程序(=包ID)内我“连接的方式'(哪个应用程序接收我发送的输入事件)?
我实现一个自定义键盘遵循本指南的INPUTMETHOD(自定义键盘)的应用:http://developer.android.com/guide/topics/text/creating-input-method.htmlAndroid的 - 确定调用
有没有从我的KeyboardService的应用程序(=包ID)内我“连接的方式'(哪个应用程序接收我发送的输入事件)?
奇怪的是,在一天中的6个意见,认为这个话题更有趣。好吧,无论如何,我找到了一个解决方案,如果有人需要它,这里是代码。
从InputMethodService
其可能接收InputBinding
:
private String getCallerPackageId() {
InputBinding binding = getCurrentInputBinding();
return getApplicationContext().getPackageManager().getNameForUid(binding.getUid());
}
什么是'getCurrentInputBinding()'? –