Android: why is my OnKeyListener() not called?

前端 未结 3 1731
情话喂你
情话喂你 2021-01-01 11:33

I defined an EditText-field and I want to be informed when the user edits that fields. So I thought: simple - I add an OnKeyListener and so I did. But even though the text f

3条回答
  •  盖世英雄少女心
    2021-01-01 12:01

    Are you using the soft keyboard (ime) to type in the edit text? I believe that the onKeyListener only gets invoked with events from the hardware keyboard. You are better off using the TextWatcher if you can. onKeyListener not working with soft keyboard (Android)

提交回复
热议问题