Skip to content

Instantly share code, notes, and snippets.

@ckashby
Created July 25, 2014 18:59
Show Gist options
  • Save ckashby/cb3f3bdfb5cad0936adc to your computer and use it in GitHub Desktop.
Save ckashby/cb3f3bdfb5cad0936adc to your computer and use it in GitHub Desktop.
EditText etValue = (EditText) findViewById(R.id.etValue);
etValue.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// Fires right as the text is being changed (even supplies the range of text)
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// Fires right before text is changing
}
@Override
public void afterTextChanged(Editable s) {
// Fires right after the text has changed
tvDisplay.setText(s.toString());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment