editText.addTextChangedListener(watcher);
自定義watcher監聽器:
final TextWatcher watcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
//在這裏進行查詢ID下面的name和age操作,並把查詢結果付給右邊的對話框
}
}
};