Reputation: 551
hi all how to implement addition of two numbers code without using button the result should be generated automatically when we enter value into text fields from key board, help me to solve the problem.
Upvotes: 0
Views: 166
Reputation: 9590
You can use TextWatcher like below code:
editText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
});
Refer:
Upvotes: 4