Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

多个adapter(DelegateAdapter.Adapter),单个adapter数据刷新失败 #517

Open
kaishuiWang opened this issue Nov 4, 2020 · 1 comment

Comments

@kaishuiWang
Copy link

项目中有多个adapter(DelegateAdapter.Adapter),并delegateAdapters.add(adapter),后面有个场景,需要对单个adapter进行数据更改,并局部刷新
List applicationInfoBeans = resourcesInfos.subList(0, 4);
adapter.setData(applicationInfoBeans);
adapter.notifyDataSetChanged();
该方法会失败并crash。求助中

@kaishuiWang
Copy link
Author

使用delegateAdapter.notifyItemRangeRemoved(4,resourcesInfos.size() - 4);类似方法刷新即可。但是该方法使用,移除item时候会有残留item的效果,还不知如何处理

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant