首先很是感谢回帖的朋友,让我学到很多东西,尽管没有经过那种方案解决问题,但我依旧是感谢万分。程序员
多是脾气问题,我是不达目的誓不罢休的那种脾气,今天花了一天时间,研究问题,经过下面那种方式解决了问题,虽然很Low...但我仍是很开心,有了收获,有了所得,付出值得,作程序员是要兴趣和激情的,有了这两项,我想我必定能够愈来愈向大神们看起吧!ide
解决了,我直接继承自ListActivity,经过getListView()方法得到ListView对象,而后在onDestroy()方法里将全局ListView置为null,固然自定义方法setData()里也进行了判断。code
/** * 获取传递过来的数据 */ private void setData() { Intent intent=getIntent(); Information info = (Information) intent.getSerializableExtra("info"); if (list1==null) { list1=info.getResult().getList(); }else { list1.clear(); adapter.notifyDataSetChanged(); list1=info.getResult().getList(); } }
@Override protected void onDestroy() { freshDataAndAdapter(); super.onDestroy(); } /** *刷新数据和adapter * / private void freshDataAndAdapter() { lvDetial.removeAllViewsInLayout();; list1.clear(); adapter.notifyDataSetChanged(); }