标签:
1
etBarCode.addTextChangedListener(watcher);
2
private TextWatcher watcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (editable.length() == 0) {
btnConfirm.setEnabled(false);
} else {
btnConfirm.setEnabled(true);
}
}
};
标签:
原文地址:http://www.cnblogs.com/520-1314/p/5562828.html