1.方案一
暴力破解 禁用复用
helper.setIsRecyclable(false);
2.方案二
1.先移除监听
if (hold.et.getTag() instanceof TextWatcher){ hold.et.removeTextChangedListener ((TextWatcher) hold.et.getTag());}
2.设置值
hold.et.setText("");
3.添加监听
TextWatcher watcher = 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) {
String trim = s.toString().trim();
item.setInputNum(trim);
}
};
hold.et.addTextChangedListener(watcher);
4.设置tag值
input_et.setTag(watcher);