标签:listview notifydatasetchanged
private List<RecentItem> recentItems; ...... recentItems = getData() mAdapter.notifyDataSetChanged();
private List<RecentItem> recentItems; ...... recentItems.clear(); recentItems.addAll(getData); mAdapter.notifyDataSetChanged();原因:
protected void onResume() { mAdapter.notifyDataSetChanged(); super.onResume(); }
protected void onResume() { recentItems.clear(); recentItems.addAll(recentDB.getRecentList()); mAdapter.notifyDataSetChanged(); super.onResume(); }
void
|
Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself.
|
ListView中notifyDataSetChanged()无法刷新数据的错误实例
标签:listview notifydatasetchanged
原文地址:http://blog.csdn.net/u013670933/article/details/44080397