Listen to any changes in a cursor in android

前端 未结 2 447
星月不相逢
星月不相逢 2021-01-13 08:43

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

Note:(I am not using any data adapter)

2条回答
  •  遥遥无期
    2021-01-13 08:52

    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.

提交回复
热议问题