In my application am using customized list-view with text view,edit-text and buttons.When i click the button in \"0\"Th position and am change the text view values in \"0\"T
I faced the same issue. The reason of the issue is described in the previous answer, however the suggested code block did not help resolving the problem in my case.
I added 350 records to my list view and one adapter object has four EditTexts.
Unexpected behaviors were occurring with TextWatcher listener always.
I used focus check listener to solve this problem:
holder.priceView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus)
{
// saving data on focus loss.
p.setPrice(holder.priceView.getText().toString());
}
}
});
// holder is my ViewHolder object , priceView is a editText in holder object, p is a reference of my data model.
This works, but the real time updates can be not as expected - like text watchers.
And there is the worst case, when firing last action (without focus losing, last edited value is not triggered and updated).