如何检测editText的删除(退格)键事件?我尝试过使用TextWatcher,但是当editText为空时,当我按下删除键时,没有任何反应.即使没有文本,我想检测删除键按下一个editText.
I needed to format money values entered into an EditText
so I used a TextWatcher
but now I have issues with backspace in soft keyboard.
Normally if you hold the backspace key in the keyboard, it keeps removing characters in EditText
until there is nothing left. After adding the TextWatcher
, you need to manually press the backspace button many times in order to completely get rid of all characters as holding it no longer works.
How do I …