-1
我正在與tutorial一起工作ExpandableListView
。ExpandableListAdapter - 無法實例化類型ExpandableListAdapter
在MainActivity.java
部,有在
listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
線錯誤。
我更改了我的ExpandableListAdapter.java
類名,但MainActivity仍然存在錯誤。
下面的代碼:
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.qlist_main);
// preparing list data
prepareListData();
listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
我怎樣才能解決這個問題?
發佈導致問題的代碼 – Blackbelt