1 ,首先在 设定Tag : mHolder.edPrdRectify.setTag(position);
2,在设定的editview 写监听回调 :判断tag是否相等 if ((Integer) mHolder.edPrdRectify.getTag() == position)
在赋值 listOfPendingRectifyInfos.get(position)
.setRectifiReplySituation(arg0.toString());
一下是代码:
//设置Tag
mHolder.edPrdRectify.setTag(position);if (isCanEdit) {
// mHolder.edPrdRectify.addTextChangedListener(null);
// //清除上个item的监听,防止oom
mHolder.edPrdRectify.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence arg0, int arg1,
int arg2, int arg3) {
}
@Override
public void beforeTextChanged(CharSequence arg0, int arg1,
int arg2, int arg3) {
}
@Override
public void afterTextChanged(Editable arg0) {
//当填写的 EditText 位置等于标记的时候再复制到 是定的数据集合中
if ((Integer) mHolder.edPrdRectify.getTag() == position) {
listOfPendingRectifyInfos.get(position)
.setRectifiReplySituation(arg0.toString());
}
Logs.e(TAG, "onTextChanged -set 后 :"
+ listOfPendingRectifyInfos);
}
});