onKeyListener not working on virtual keyboard

前端 未结 6 954
南方客
南方客 2020-12-01 16:00

I don\'t understand why this piece of code is not working. Only backspace and return key are detected. Listener doesn\'t fire for any other key. My device is Nexus One.

6条回答
  •  执笔经年
    2020-12-01 16:30

    We had the TextWatcher problem on iPhone as well -- if buffer is empty, keyboard does not send del event. We worked around it by preloading the keyboard buffer with 1000 characters. Luckily, our app hid the edit field behind the keyboard so the 1000 characters are not seen. It's ugly, but it works (unless the user hits 1000 deletes in a a row prior to entering any data!)

提交回复
热议问题