1

I was looking at the answer for making a Custom CursorLoader, and was wondering that if the data changes would there will be a notification of the data changing so that the list updates?

Community
  • 1
  • 1
Hank
  • 3,367
  • 10
  • 48
  • 86

2 Answers2

6

I'm using the compatibility library loader framework. When content changes I just call this and everything gets updated:

    getSupportLoaderManager().getLoader(YOUR_LOADER).onContentChanged();
felix
  • 123
  • 2
  • 7
0

You could call notifyDataSetChanged on your adapter so that the ListView will display the updated cursor content.

From the documentation:

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

skynet
  • 9,898
  • 5
  • 43
  • 52
  • notifyDataSetChanged does not requery the adapters data. It only tells the ListView "Hey my data changed so you should repopulate the list with my current adapter" That is all it does... – Jona Dec 10 '11 at 14:43