Listen to any changes in a cursor in android

前端 未结 2 522
星月不相逢
星月不相逢 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条回答
  •  Happy的楠姐
    2021-01-13 08:49

    As far as I know, if your changes in the cursor are due to requery() or some other method on the cursor like close(), then you can use a dataset observer to track the changes.

    But you will need a content provider, if you want to be updated automatically when something changes in your data source, eg your sqlite database. In that case, you can check the info posted below.

    What cursor are you using?

提交回复
热议问题