1

When i got some cursor i want to be aware for changes, so i have used the registerContentObserver() on my cursor and when change occur i just notify that change happened. i looked into the notifyChange method on android developer and i didnt see any way to pass some metadata .

when i said metadata i meant any other object which tell me what change happen like delete/update/insert

Lior
  • 832
  • 6
  • 6

1 Answers1

0

You can't specifically add any metadata per se, but you can bend the system to pass this information anyway.

When registering your content observer, set the notifyForDescendants parameter to true. Then in your ContentProvider, generate a different uri to add information.

For example if the uri you normally use is content://com.example.app.provider/item/42, you can use one of the following uris to add information :

  • content://com.example.app.provider/item/42/inserted
  • content://com.example.app.provider/item/42/updated
  • content://com.example.app.provider/item/42/deleted
XGouchet
  • 10,002
  • 10
  • 48
  • 83