简体   繁体   English

用于获取虚拟键盘按键的Android虚拟键盘KeyListener

[英]Android Virtual Keyboard KeyListener for getting Virtual Keyboard key presses

我希望在每次按键时我需要更改计数器类似于Tweeter Thing但问题是OnEditorActionListener仅在用户按EnterDone键时调用更改,我可以为此找到解决方案

You could use an OnKeyListener if you do really want to catch keystrokes. 如果你真的想捕捉击键,你可以使用OnKeyListener

However, if what you're really interested in is knowing when the text in an EditText View has changed you might find it easier to use a TextWatcher . 但是,如果您真正感兴趣的是知道EditText视图中的文本何时发生了变化,您可能会发现使用TextWatcher更容易。 You would put your code which updates something based on the context of the EditText in the afterTextChanged() method . 您可以根据afterTextChanged()方法中 EditText的上下文更新某些内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM