Search code examples
androidandroid-cursor

How to requery for a cursor now if requery is deprecated?


As per the title, if we used to call cursor.requery(), but it is now deprecated. How do you call this function now?

This method is deprecated. Don't use this. Just request a new cursor, so you can do this asynchronously and update your list view once the new cursor comes back.

So how does one request a new cursor and pass it back to the adapter?


Solution

  • Re-initialize cursor when your any DML query execute.

    See also this.