Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道每次打开或恢复时如何更新列表视图。我放了这段代码,但没有按应有的方式工作。有什么建议么?
protected void onResume() { // TODO Auto-generated method stub super.onResume(); adapter = db.getAdapter(); variable.setAdapter(adapter); }
尝试这个。
adapter.notifyDataSetChanged();
试试这个片段:
yourAdapter.notifyDataSetChanged();