I have a ListView with a custom adapter. I want to connect a listener to this ListView, which runs whenever the data in the ListView changes, as this can happen in a wide variety of ways, and I need a different view to update whenever the ListView is updated. Essentially, I want this to work whenever a notifyDataSetChanged () is called directly or indirectly (via add (), remove (), etc.):
Whenever an item in the list is deleted, I want this to call. Whenever an item is added to the list, I want it to call. etc. etc.
Should I create my own listener for this (and if so, a short explanation of how this will be very useful) or is there a built-in way to listen to these events?
source share