当我将 a 设置TextWatcher
为EditText
这样时:
editText1.addTextChangedListener(watcher);
接口方法onTextChanged
和被触发afterTextChanged
,beforeTextChanged
无论是否EditText
包含文本。
我假设这些方法仅在绑定后的文本更改后调用。我可以防止这种行为吗?我是否犯了导致这种行为的逻辑错误?
谢谢
编辑:
我setText()
以前addTextChangedListener
。
调用栈:
DalvikVM[localhost:8600]
Thread [<1> main] (Suspended)
<VM does not provide monitor information>
EditText(TextView).sendOnTextChanged(CharSequence, int, int, int) line: 7875
EditText(TextView).setText(CharSequence, TextView$BufferType, boolean, int) line: 3488
EditText(TextView).setText(CharSequence, TextView$BufferType) line: 3341
EditText.setText(CharSequence, TextView$BufferType) line: 90
EditText(TextView).setText(CharSequence) line: 3316
EditText(TextView).onRestoreInstanceState(Parcelable) line: 3216
EditText(View).dispatchRestoreInstanceState(SparseArray) line: 10079
...