I know a little bit about TextWatcher but that fires on every character you enter. I want a listener that fires whenever the user finishes editing. Is it possible? Also in TextWatcher I get an instance of Editable but I need an instance of EditText. How do I get that?
EDIT: the second question is more important. Please answer that.
First, you can see if the user finished editing the text if the
EditTextloses focus or if the user presses the done button (this depends on your implementation and on what fits the best for you).Second, you can’t get an
EditTextinstance within theTextWatcheronly if you have declared theEditTextas an instance object. Even though you shouldn’t edit theEditTextwithin theTextWatcherbecause it is not safe.EDIT:
To be able to get the
EditTextinstance into yourTextWatcherimplementation, you should try something like this:Note that the above sample might have some errors but I just wanted to show you an example.