Best way to detect if TextView's text has been changed? Something similar to dirty check -- so I can only save the textfields that's changed.
add textChangeListener to text view as following.
write your stuff in 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
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With