[英]How to get new update for my listview in android
I want to get the update for my listview whenever i click the back button from the emulator. 每当我单击模拟器中的“后退”按钮时,我都希望获取列表视图的更新。 But i my adapter do not accept notifyDataSetChanged(). 但是我的适配器不接受notifyDataSetChanged()。 Is there a way for me to do this? 我有办法吗?
Below is my code for displaying the listview 下面是我用于显示列表视图的代码
adapter = new SimpleAdapter(BookmarkActivity.this,
eventsList, R.layout.bookmark_list, new String[] {
TAG_EID, TAG_ENAME, TAG_CNAME,
TAG_CREATED_AT }, new int[] { R.id.bk_eid,
R.id.bk_ename, R.id.bk_cname,
R.id.bk_created_at });
// updating listView
setListAdapter(adapter);
Call the same code in onResume()
; 在onResume()
调用相同的代码; I think that will do it:) 我认为可以做到:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.