我尝试在导航抽屉中创建一个 ExpandableListView。我尝试了一个示例代码,但在编译之前我得到了这个错误。
public class MainActivity extends Activity {
ExpandableListAdapter listAdapter;
ExpandableListView expListView;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// get the listview
expListView = (ExpandableListView) findViewById(R.id.left_drawer);
// preparing list data
prepareListData();
listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
错误在这一行: listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
为什么它说无法实例化类型 ExpandableListAdapter ?