-1
我遇到了ICS上的错误。使用ListView并随着时间的推移更改适配器,直到向下滚动然后返回顶部,我才看到listView内容的任何更改。 我用这些命令通知更改适配器:列表视图未重新载入
adap.notifyDataSetChanged();
adap.notifyDataSetInvalidated();//added just to see if it solved... but it didn't resolve
在姜饼代码工作完美。
你叫''notifyDataSetChanged在你的主线程即你的UI线程()? – Abhilasha 2012-07-20 09:17:33
每次还要创建一个新的适配器,当你填充'ListView'像'适配器=新ListViewCustomAdapter( \t \t \t \t \t \t \t \t \t \t \t SearchAssetActivity.this,itemList中); \t \t \t \t \t \t \t \t \t lview3.setAdapter(适配器); \t \t \t \t \t \t \t \t \t adapter.notifyDataSetChanged();' – Abhilasha 2012-07-20 09:19:38
好了,重新创建ListView的工作......但为什么notifyDataSetChanged()不工作? PS:我在UI线程中调用它 – Spotlight 2012-07-20 09:37:43