Best way to determine if TextView text has been modified?

Best way to determine if TextView text has been modified? Something like a dirty check - so that I can only save changed text fields.

+7
source share
1 answer

add textChangeListener to the text view as follows. write your stuff in the onTextChanged() method.

  TextView txtview = new TextView(this); txtview.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }); 
+16
source

All Articles