I\'m using RecyclerView to display name of the items. My row contains single TextView. Item names are stored in List
do this when you want to add view(like notifyData or addView or something like that)
if(isAdded()){
//
// add view like this.
//
// celebrityActionAdapter.notifyItemRangeInserted(pageSize, 10);
//
//
}
I am altering data for the RecyclerView in the background Thread. I got the same Exception as the OP. I added this after changing data:
myRecyclerView.post(new Runnable() {
@Override
public void run() {
myRecyclerAdapter.notifyDataSetChanged();
}
});
Hope it helps