Android TextWatcher内容监听死循环案例详解

  xxxEdit.addTextChangedListener(new TextWatcher() {

  @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { }

  @Override public void onTextChanged(CharSequence s, int start, int before, int count) {}

  @Override

  public void afterTextChanged(Editable s) {

  xxxEdit.removeTextChangedListener(this);

  xxxEdit.setText("新取值");

  xxxEdit.addTextChangedListener(this);

  }

  });