android adapter.notifyDataSetChanged() 页面没有更新的原因

使用 adapter.notifyDataSetChanged() 时,必须保证传进 Adapter 的数据 List 是同一个 List,而不能是其他对象,否则无法更新 listview。

 

如果adapter的数据源需要重新赋值,可先调用 list.clear(),清除所有数据,再将新数据添加到原list中

posted @ 2020-12-21 23:13  乱炖er  阅读(483)  评论(0编辑  收藏  举报