myExpandableListView.addHeaderView(headView);
myExpandableListView.addFooterView(footerView);
原因很简单:这两句话要放到myExpandableListView.setAdapter之前!!