How to automatically re-query with LoaderManager

前端 未结 1 1470
鱼传尺愫
鱼传尺愫 2021-01-27 09:41

I have an app that shows data from a SQLite DB and the data changes constantly, so obviously, I thought I should use a LoaderManager to show the data.

do I read a bit ab

相关标签:
1条回答
  • 2021-01-27 10:24

    the problem starts when the database is changed from a 'BroadcastListener' while the activity is still running... is there a way to automate re-query behind the scenes?

    Have the BroadcastReceiver use the insert(), update(), replace(), and delete() methods on SQLiteCursorLoader to modify the database. Then, the Cursor will be re-loaded automatically.

    0 讨论(0)
提交回复
热议问题