我一直在使用简单的适配器列表视图和我有问题,尽管调用adapter.notifyDataSetChanged()我的列表视图没有得到更新;所以它在简单的适配器中工作?下面是我的简单适配器的代码。 我宣布简单的适配器全球listview没有得到更新
adapter = new SimpleAdapter(
getActivity(), ssLst,
R.layout.surgerysch_item, new String[]{
TAG_SIMRDNO, TAG_SIPNME, TAG_SISEX,
TAG_SIDOB, TAG_SIPROC, TAG_SIOTNME,
TAG_SIOTME, TAG_DRNAME}, new int[]{R.id.txtsimrdNo,
R.id.txtsiptnNme, R.id.txtsiSex,
R.id.txtsiDob, R.id.txtsiProc,
R.id.txtsiotNme, R.id.txtsiotTme, R.id.txtDrnme});
lstViw.setAdapter(adapter);
adapter.notifyDataSetChanged();
调用'adapter.notifyDataSetChanged();'在将其设置为列表视图之前 – SripadRaj
@Enlightened如何获取'SimpleAdapter'内的arrayList?您是在创建新对象还是仅仅引用? – Godather
调用adapter.notifyDataSetChanged()方法没有意义。紧接着设置适配器后。发布SimpleAdapter类。 –