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

J.R*_*J.R 4 android expandablelistview expandablelistadapter

在我的项目中,我试图BaseExpandableListAdapter通过调用getAdapter()方法访问设置为ExpandableListView 的adapter().但getAdapter()回报android.widget.ExpandableListConnector.

这是我的代码

mExpandableListView.setAdapter(new ItemsExpListAdapter(navigationDrawerItems, getActivity()));
Log.e("adapter" , mExpandableListView.getAdapter().getClass().toString());
Run Code Online (Sandbox Code Playgroud)

我正在这样的logcat

在此输入图像描述

has*_*san 11

你应该使用:

mExpandableListView.getExpandableListAdapter();
Run Code Online (Sandbox Code Playgroud)