kiduxa
kiduxa

Reputation: 3351

how to know in the main layout that a ListView has been changed?

Suppose that I have a main layout that has a ListView. This ListView has a custom cursor adapter. When my list change, is there anyway to know, in the main activity, if my list has been changed?. Inside my custom cursor I call to this.notifyDataSetChanged();. Is there any method that can I use to know when notifyDataSetChanged() has been called?.

Upvotes: 1

Views: 48

Answers (1)

Code-Apprentice
Code-Apprentice

Reputation: 83527

You need to create a DataSetObserver and register it with your adapter by calling registerDataSetObserver().

p.s. I strongly suggest that you familiarize yourself with the Android API Reference. This is a great tool to help you find the classes and methods which are available in the Android API.

Upvotes: 1

Related Questions