How to update ListView in case of CursorAdapter usage?

后端 未结 6 846
北荒
北荒 2020-12-09 10:11

The reason I\'m asking that is because requery() is deprecated. What is the best way now to refresh your ListView?

6条回答
  •  伪装坚强ぢ
    2020-12-09 10:47

    I tried to add my response as a comment but failed for some reason.

    cursoradapter.notifyDatasetchanged() should not work as your adapter is linked to a "cursor" which holds a "query" that was executed before dataset was changed. Hence one would require to change "cursor" by doing the "new query" and link to cursoradapter using cursoradapter changecursor().

提交回复
热议问题