I\'m using RecyclerView
to display name of the items. My row contains single TextView
. Item names are stored in List
I figure out that, for me this exception comes when two things happens at the same time i.e.
1) Scrolling of recyclerview
2) data set getting changed
So, I solved this problem by disabling the scroll till the notifydatasetchanged is called.
leaderAdapter.notifyDataSetChanged();
pDialog.hide();
To disable the scroll, I have used a progress dialog, whose setCancelable is false.
pDialog = new ProgressDialog(getActivity());
pDialog.setMessage("Please wait...");
pDialog.setCancelable(false);
The trick here is to enable the scrolling only when the data set has been updated.