Simply create a new instance of TextWatcher and implement the required methods
There you have it. For more info checkout http://developer.android.com/reference/android/text/TextWatcher.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.text.TextWatcher; | |
private void addEditTextChangeListeners() { | |
TextWatcher textListener = new TextWatcher() { | |
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {} | |
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {} | |
public void afterTextChanged(Editable editable) { | |
saveButton.setEnabled(editable.length() > 0); | |
} | |
}; | |
url.addTextChangedListener(textListener); | |
} |
No comments:
Post a Comment