Reputation: 235
I'm developing an android application.. I want to set a text in an editText based on the user's entered keys from softkeyboard.
How can I change the text content before it is set in the EditText in android application???
Upvotes: 0
Views: 197
Reputation: 1208
This may help you.
editText.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
public void afterTextChanged(Editable s) {
}
});
Upvotes: 1
Reputation: 18670
With TextView.setOnEditorActionListener() you can be notified when an action is performed in the EditText.
Upvotes: 2