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.
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.
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>