1

在我的应用程序中,我想使用他们的默认软输入来获取用户输入,但我没有使用任何输入区域。我已经弹出了软输入,但现在我需要从那个软输入中监听键盘事件。

我认为这将是一个已解决的问题,但我在文档方面遇到了问题。我想获得用户的软输入在我的应用程序中生成的内容,即使没有焦点输入字段。

这措辞够清楚吗?

干杯。

4

2 回答 2

0

Hi there goodaccountname,

I think the better way is to add a hidden textview and request a focus on it after opening the keyboard and use textwatcher (http://developer.android.com/reference/android/text/TextWatcher.html) to listen to every change in the text. That's all. I did not try this but these will help. Good day!

于 2015-02-16T02:16:16.690 回答
0

打开软输入后,InputManager#showSoftInput(View view,int flags)您必须将自己设置为此的OnKeyListenerview ,您将收到所有关键事件。

于 2011-12-13T11:26:44.947 回答