1 回答
TA贡献1797条经验 获得超6个赞
尝试使用 notifyDataSetChanged
appAdapter = new AppAdapter(context, getInstalledApps());
final LinearLayoutManager layoutManager = new LinearLayoutManager(context);
recyclerInstalledApps.post(new Runnable() {
@Override
public void run() {
recyclerInstalledApps.setLayoutManager(layoutManager);
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(context, R.anim.recycler_layout_animation);
recyclerInstalledApps.setLayoutAnimation(controller);
recyclerInstalledApps.scheduleLayoutAnimation();
recyclerInstalledApps.setAdapter(appAdapter);
}
});
appAdapter.notifyDataSetChanged();
添加回答
举报