Android 如何清除ExpandableListView?

Android 如何清除ExpandableListView?,android,expandablelistview,expandablelistadapter,Android,Expandablelistview,Expandablelistadapter,我使用可扩展列表视图作为树状视图结构,它需要不断更新,但由于我无法清除当前可扩展列表视图,它会显示以前的数据和新数据。就像我最小化并再次打开应用程序一样,列表视图中存在重复数据 ExpandableListAdapter=新的ExpandableListAdapter()//或者您使用/创建的任何适配器listView.setAdapter(适配器) yourExpandableListView.setAdapter((BaseExpandableListAdapter)null); 请在更新

我使用可扩展列表视图作为树状视图结构,它需要不断更新,但由于我无法清除当前可扩展列表视图,它会显示以前的数据和新数据。就像我最小化并再次打开应用程序一样,列表视图中存在重复数据

ExpandableListAdapter=新的ExpandableListAdapter()//或者您使用/创建的任何适配器listView.setAdapter(适配器)
yourExpandableListView.setAdapter((BaseExpandableListAdapter)null);

请在更新触发事件上尝试此操作,在适配器上调用notifyDataSetChanged()。您可以告诉我更新触发事件的情况吗?您可以共享代码吗?,我需要看看你是如何为可扩展列表视图设置数据的。我相信我们可以用它设置一个适配器,我也做了同样的事情,但是如果再次调用构成列表的方法,我想清除当前列表。在适配器设置前,请先用null check清除适配器中设置的arraylist。你能写一个简短的语法吗你想表达什么?