Reputation: 1258
I have a Broadcast Receiver that inserts info into a table when sms is received. In the main activity i have a Cursor from a query on that table. Is it possible for me to set the cursor to requery every time the BR makes changes to the Table, so that it can reflect in the cursor.
I am currently not using OpenHelper, simply opening the database in the Activity and doing a query to obtain a cursor.
Upvotes: 2
Views: 1163
Reputation: 86948
Yes, this is possible and probably easy.
swapCursor()
.add()
or insert()
.Either of these methods cause the View bound to your adapter to refresh automatically.
Upvotes: 1