Skip to content
pyricau edited this page May 10, 2012 · 5 revisions

Since AndroidAnnotations 2.6

@AfterTextChange

This annotation is intended to be used on methods to receive events defined by android.text.TextWatcher.afterTextChanged(Editable s) after the text is changed on the targeted TextView or subclass of TextView. The annotation value should be one or several R.id.* fields that refers to TextView or subclasses of TextView. If not set, the method name will be used as the R.id.* field name. The method may have multiple parameter:

  • A android.widget.TextView parameter to know which view has targeted this event
  • An android.text.Editable to make changes on modified text.

Some usage examples of @BeforeTextChange annotation :

 @AfterTextChange(R.id.helloTextView)
 void afterTextChangedOnHelloTextView(Editable text, TextView hello) {
 	// Something Here
 }
 
 @AfterTextChange
 void helloTextViewAfterTextChanged(TextView hello) {
 	// Something Here
 }
 
 @AfterTextChange({R.id.editText, R.id.helloTextView})
 void afterTextChangedOnSomeTextViews(TextView tv, Editable text) {
 	// Something Here
 }
 
 @AfterTextChange(R.id.helloTextView)
 void afterTextChangedOnHelloTextView() {
 	// Something Here
 }

Using AndroidAnnotations

Questions?

Enjoying AndroidAnnotations

Improving AndroidAnnotations

Clone this wiki locally