开发者

Android Sqlite watch table for data updates

Say my application has a ListView that displays information from a Sqlite database, using a SimpleCursorAdapter. Other threads will be updating the relevant tables in the database, and the ListView should update automatically.

The SimpleCursorAdapter I create doesn't seem to be watching the database for updates. I call the following function after updating the table.

((CursorAdapter) this.getLi开发者_开发知识库stAdapter()).notifyDataSetChanged();

What is the best way to do this?


Using just a SimpleCursorAdapter you will need to call notifyDataSetChanged on the ListView to force it to refresh.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜