我正在处理可扩展列表视图。但是我收到错误“无法实例化类型ExpandableListAdapter”。 我的代码是---
public class Calculator_new_Pop extends Dialog implements View.OnClickListener{
ExpandableListAdapter listAdapter;
public Calculator_new_Pop(Activity parent) {
// TODO Auto-generated constructor stub
super(parent);
this._act = parent;}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.calculator);
listAdapter = new ExpandableListAdapter(_act, listDataHeader, listDataChild);
//
}}
任何人都可以帮助我吗???
答案 0 :(得分:0)
Chanege this
listAdapter = new ExpandableListAdapter(_act, listDataHeader, listDataChild);
带
listAdapter = new ExpandableListAdapter(this);
listAdapter (_act, listDataHeader, listDataChild);
OR
listAdapter = new ExpandableListAdapter(ActivityName.this);
listAdapter (_act, listDataHeader, listDataChild);
如果您想继续使用代码,请使用_act=new Activity(context);