How to update ListView in case of CursorAdapter usage?
requery()
updates a Cursor
, not a CursorAdapter
. As you say, it has been deprecated, and its replacement is:
oldCursor = myCursorAdapter.swapCursor(newCursor); // hands you back oldCursor
or:
myCursorAdapter.changeCursor(newCursor); // automatically closes old Cursor
myCursorAdapter.notifyDataSetChanged()
notifies the ListView
that the data set has changed, and it should refresh itself