我问那的原因是因为重新查询()
是pcated德$ P $。什么是现在刷新最好的办法你的的ListView
?
The reason I'm asking that is because requery()
is deprecated. What is the best way now to refresh your ListView
?
重新查询()
更新一个光标
,不是的CursorAdapter
。正如你所说,它已经去precated,其更换为:
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
或
myCursorAdapter.changeCursor(newCursor); // automatically closes old Cursor
myCursorAdapter.notifyDataSetChanged()
通知的ListView
,该数据集已经变了,它应该自动刷新
myCursorAdapter.notifyDataSetChanged()
notifies the ListView
that the data set has changed, and it should refresh itself