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); } }};
时间: 2024-11-03 12:24:25