安卓:李铁SoftKeyboard(InputMethodService)到一个EditText [英] Android: Tie a SoftKeyboard (InputMethodService) to an EditText

查看:195
本文介绍了安卓:李铁SoftKeyboard(InputMethodService)到一个EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图说服一个的EditText -view只使用了我写的SoftKeyboard。它的窃听我几天已经,我不能相信这是不可能做到的。我可能看不到明显的...

I'm trying to convince an EditText-view to only use the SoftKeyboard that I wrote. It's bugging me for a few days already and I can't believe that this isn't possible to do. I might not see the obvious...

到目前为止,我管理的基础上附带了Android SDK中的样品写我自己的SoftKeyboard。我可以手动选择它作为输入法(长按,输入法,*挑*)。该SoftKeyboard然后工作正常,并做我想要的一切。我还清理上下文菜单不允许更改输入方法(很明显,我现在需要它在菜单否则我将无法选择我SoftKeyboard)。

So far I managed to write my own SoftKeyboard based on the sample that comes with the Android SDK. I'm able to manually select it as the input method (long click, input method, *pick*). The SoftKeyboard then works fine and does everything I want. I also cleaned up the context menu to disallow changing the input method (obviously I currently needed it to be in the menu otherwise I wouldn't be able to choose my SoftKeyboard).

在换句话说留下的唯一一件事就是绑SoftKeyboard到的EditText

In other words the only thing left is to tie the SoftKeyboard to the EditText.

我注意到了一堆输入法* -attributes上的的EditText ,但他们似乎并没有被我的问题非常有用,因为我不希望改变对操作键东西。 inputMethod 需要一个的KeyListener ,其中SoftKeyboard是不是(我试图使它之一,但似乎有一个问题的类加载器,因为它不会找到我的课=> ClassNotFoundException的)。

I noticed the bunch of ime*-attributes on the EditText, but they don't seem to be useful for my problem as I don't want to change anything about the action key. inputMethod requires a KeyListener, which the SoftKeyboard is not (I tried to make it one, but there seems to be a problem with the class-loader as it wouldn't find my class => ClassNotFoundException).

任何人都可以请点我到一些有用的信息?

Can anyone please point me to some useful information?

推荐答案

目前,我正在重塑我的方法,并尝试无 InputMethodService 工作。我把样品code作为处理用户输入的参考。基本上,它应该只是在需要的时候弹出一个简单的观点。

I'm currently reinventing my approach and try to work without the InputMethodService. I keep the sample code as a reference for handling the user input. Basically it should just be a simple view that pops up when needed.

在进一步研究后,我发现大约一个应用程序专用的软键盘一个真正有用的问题。如果碰上了我的情况,在那里寻找。

After further research I found a really helpful question about an App-specific soft-keyboard. If you run into my situation, look there.

这篇关于安卓:李铁SoftKeyboard(InputMethodService)到一个EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆