I have a listview which contains an editext for each position. I have assigned a textwatcher for each edittext as below:
holder.prodQuantity.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) {
if(isDialog) {
recallMap.put(productId, s.toString());
}
}
The problem here is, whenever I add a value to the first edit text, the text watcher gets triggered for all items of the listview.
recallMap
should contain only the id of the selected row and the value entered in the edit text of that row, but in this case, recalMap
has all the ids and the value entered in the first edit text for all.
Please note that, this is happening without any scroll.
Any help would be much appreciated. Thanks.