expandable-recycler-view icon indicating copy to clipboard operation
expandable-recycler-view copied to clipboard

notifyParentDataSetChanged doesn't refresh items

Open bene25 opened this issue 8 years ago • 5 comments

Hello. I have an adapter where mostly child items are changed. I create it like this - mEventAdapter = new SubCategoryExpandableRecyclerAdapter(context, getEventItems(mChannelId)), where getEventItems(mChannelId) returns array. Then I get in array new items and call notifyParentDataSetChanged after, but data in adapter doesn't changed.

bene25 avatar Oct 20 '16 13:10 bene25

Hello, I have the same problem. You have got to solve it?

volkdown avatar Dec 04 '16 10:12 volkdown

Not yet. We leaved it as is for some time.

bene25 avatar Dec 05 '16 10:12 bene25

@bene25 @volkdown

Sorry for the late reply here. Any chance you can reproduce this in the existing samples or create a small light sample that shows the issue?

At a glance, it may be that you are getting a new array reference instead of editing the existing list. So the call to notifyParentDataSetChanged does nothing since the array is still pointing to old data.

paul-turner avatar Feb 03 '17 17:02 paul-turner

I'm sorry, but everything works. I can not properly use the data update. I did like this mAdapter.setParentList(generateData(mData), false); mAdapter.notifyDataSetChanged(); It works for me.

volkdown avatar Feb 04 '17 04:02 volkdown

No problem, glad it's working. Will see if this is the case for bene25 as well.

paul-turner avatar Feb 07 '17 21:02 paul-turner