Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting backspace on an empty EditText

I'm trying to detect a soft keyboard backspace in an empty EditText view. I've searched Stack Overflow and also Google and ~20 similar questions, but none have a solution for detecting a backspace in an empty EditText.

All of the answers evolve around this blog article https://code.i-harness.com/en/q/4a914a which specifically notes in the end that this does not detect backspace on an empty EditText view.

Help is much appreciated.

like image 358
tosi Avatar asked Sep 02 '18 01:09

tosi


1 Answers

Most reliable solution to detect any event or text change of an EditText is using TextWatcher but if EditText is already empty, you can not detect backspace/delete key event on all devices.

Please keep it in mind that it is not possible and hopefully you or any other will not waste your time.

like image 68
Vikasdeep Singh Avatar answered Nov 06 '22 13:11

Vikasdeep Singh