In Yigit Boyar and George Mount\'s talk on Android Databinding they illustrate how easy it is to bind to TextWatcher
\'s onTextChanged
(at 13:41). O
Attach an setOnFocusChangeListener
to the EditText
, and use compare the textual content with a global variable (of the previous state/content of the field) to determine whether it has changed:
mEditTextTitle.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if(!hasFocus)
// check if text has changed
}
});