What I want to do: run a background thread which calculates ListView contents and update ListView partially, while results are calculated.
W
i had the same problem. finally i got the solution
before updating listview, if the soft keypad is present close it first. after that set data source and call notifydatasetchanged().
while closing keypad internally listview will update its ui. it keep calling till closing keypad. that time if data source change it willl throw this exception. if data is updating in onActivityResult, there is a chance for same error.
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
view.postDelayed(new Runnable() {
@Override
public void run() {
refreshList();
}
},100L);