How do I create an event the moment someone types something in EditText? [closed]

3

I would like to create an event as the user is typing a word in my EditText , but I do not know how to access it.

    
asked by anonymous 02.01.2017 / 23:45

1 answer

6

You can use addTextChangedListener() . See the code below:

seuEditText.addTextChangedListener(new TextWatcher() { 
public void afterTextChanged(Editable s) { 

// Aqui você coloca o evento

} 
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
} 
public void onTextChanged(CharSequence s, int start, int before, int count) {
} 
});

See more details in the documentation . p>     

03.01.2017 / 00:29