I have never tried this before, but it should work if you check if the EditText
is in focus. There are a few ways to go about this and the most straightforward one is to check the focus of the EditText
inside your TextWatcher
methods. You'll need to do something like this:
if(mEdit1.hasFocus()) {
...
} else if(mEdit2.hasFocus()) {
...
} else if(mEdit3.hasFocus()) {
...
}
A different approach would be to use an OnGlobalFocusChangeListener on your root view and set a variable indicating with EditText
currently has focus. It would still require a lot of if
statements to check for which EditText
has the focus, but may be a more reusable solution.