How do I capture the event when an EditText is modified?

0

I need to capture the event of an EditText to erase the results I show on the screen.

    
asked by Raúl Borgarello 14.01.2018 в 03:52
source

1 answer

1

Your question is not very explicit but if we are talking about android you can capture the text change event like this:

EditText textValue = ....

    textValue.addTextChangedListener(new TextWatcher() {
                @Override
                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
                    //System.out.println(s.toString() + " " + start + " " + count + " " + after);
                }

                @Override
                public void onTextChanged(CharSequence s, int start, int before, int count) {
                    //System.out.println(s.toString() + " " + start + " " + count);
                }

                @Override
                public void afterTextChanged(Editable s) {
                    //System.out.println(s.toString());
                }
            });
    
answered by 14.01.2018 / 05:39
source