ListView移除adapter所有项的方法: 方法1: listView.setAdapter(null);
方法2: listAdapter.clear(); listAdapter.notifyDataSetChanged() ;
本文介绍了在Android开发中如何清除ListView Adapter中的所有项。提供了两种有效的方法:一是通过设置Adapter为空;二是调用Adapter的clear()方法并通知数据集改变。
ListView移除adapter所有项的方法: 方法1: listView.setAdapter(null);
方法2: listAdapter.clear(); listAdapter.notifyDataSetChanged() ;
324

被折叠的 条评论
为什么被折叠?