ExpandableListView.getAdapter() 返回 android.widget.ExpandableListConnector

ExpandableListView.getAdapter() returning android.widget.ExpandableListConnector

在我的项目中,我试图通过调用 getAdapter() 方法来访问设置为 ExpandableListView 的适配器 (BaseExpandableListAdapter)。但是 getAdapter() returns android.widget.ExpandableListConnector.

这是我的代码

mExpandableListView.setAdapter(new ItemsExpListAdapter(navigationDrawerItems, getActivity()));
Log.e("adapter" , mExpandableListView.getAdapter().getClass().toString());

我是这样进入的 logcat

你应该使用:

mExpandableListView.getExpandableListAdapter();