Search code examples
androiddatabaseandroid-cursor

Listen to any changes in a cursor in android


I would like to listen to any changes in a cursor. Is it possible to achieve this without using a contentprovider in android?

Note:(I am not using any data adapter)

Thanks


Solution

  • I found that You don't need to use content Provider.When ever the data changes(like during insertions,deletions etc..) you can just call getContentResolver().notifyChange(Uri uri, ContentObserver observer) and set a contentObserver in your activity to listen for the change.