This can only mean that your grasp of ListView is not enough. ListView relies on the data connection of the data adapter Adapter. Data modification also exists in the data source or data adapter. It does not mean that you need to regenerate the data adapter.
This can only mean that your grasp of
ListView
is not enough.ListView
relies on the data connection of the data adapterAdapter
. Data modification also exists in the data source or data adapter. It does not mean that you need to regenerate the data adapter.Use the notifyDataSetChanged() method of the adapter Adapter to update. . .
Give me an example:
Add directly to the data source List, and then notify the Adapter to update the data, adapter.notifyDataSetChanged();
Add new data to the adapter’s list and then adapter.notifiedxxx
RecyclerView cooperates with staggergroidlayoutmanager
Inherit adapter yourself
Use adapter.notifydatachanged() to notify updates