我是否必须将 ListView 与 Adapter 一起使用才能在调用 notifyDataSetChange() 后触发 getView()?

Do I have to use ListView with Adapter to make getView() get triggered after calling notifyDataSetChange()?

如果项目已更新,我想更新列表中的项目,但可能根本没有更新。

所以我的问题是:如果调用了 notifyDataSetChange() 方法但适配器中没有更改,是否会触发 getView() 方法?

更新:

adapter是不是必须和ListView一起使用才能在调用notifyDataSetChange()后触发getView()?如果我手动迭代一个适配器,然后调用 notifyDataSetChange()。会调用 getView() 吗?

它确实会触发 getView(),因为反映您的数据的视图需要刷新。

Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself

另请查看此 post,其中给出了非常详细的解释。

感谢 Mike M. 的评论。

为了在调用 notifyDataSetChange() 后触发 getView(),我必须将 Adapter 与 ListView 一起使用。正如 Mike 提到的,ListView 将调用 getView()。

这个 link 可能会有帮助:When getView() in ArrayAdapter is called