开发者

How can I implement a TextWatcher on an Activity

开发者 https://www.devze.com 2023-04-05 19:28 出处:网络
Implementing a TextWatcher on an Editable like EditText is quite simple. However, I want to listen for key input without a specific Editable in focus so that the user can launch the activity, without

Implementing a TextWatcher on an Editable like EditText is quite simple. However, I want to listen for key input without a specific Editable in focus so that the user can launch the activity, without clicking on an EditText or any开发者_如何学Gothing. So you can just start typing (hard keyboard) or hold the menu soft key until the soft keyboard comes up and then I want to register these key events.

I have tried having my Activity implement TextWatcher, however the callbacks like onTextChanged() never get called. Has anyone ever done this before?


I think at that point you want to switch to Activity.onKeyDown() and related.

0

精彩评论

暂无评论...
验证码 换一张
取 消