3
I would like to create an event as the user enters some word in my EditText
, but I don’t know how to access it.
3
I would like to create an event as the user enters some word in my EditText
, but I don’t know how to access it.
6
You can use the 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.
Browser other questions tagged java android edittext
You are not signed in. Login or sign up in order to post.
Excellent, that’s just what I needed. Thank you.
– Alex