What is the difference between ListView.invalidate() and ListView.invalidateViews()?
For me, invalidate() alone did not work. Whereas invalidateViews() worked just the way I wanted i.e. to redraw the List items.
What is the difference between ListView.invalidate() and ListView.invalidateViews()?
For me, invalidate() alone did not work. Whereas invalidateViews() worked just the way I wanted i.e. to redraw the List items.
Copyright © 2021 Jogjafile Inc.
According to Android webpage View Invalidate , ListView.invalidate() will
This redraws the Canvas background through
onDraw
event. This is useful when the looks/feel have changed.ListView.invalidateViews(), stated on the Android AbsListView invalidateViews,
I think this means it will "rebuild" the modified data associated with the ListView, and update the looks/feel. However, this updates child views as well, and it is time consuming. Normally I use notifyDataSetChanged() of BaseAdapter when data has changed.
In conclusion, use the method that is appropriate for your needs.