0

我正在处理可扩展列表视图。但我收到错误“无法实例化类型 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);

//      
}}

谁能帮我吗???

4

1 回答 1

0

改变这个

listAdapter = new ExpandableListAdapter(_act, listDataHeader, listDataChild);

listAdapter = new ExpandableListAdapter(this); 
listAdapter (_act, listDataHeader, listDataChild);

或者

listAdapter = new ExpandableListAdapter(ActivityName.this);
listAdapter (_act, listDataHeader, listDataChild);

如果你想继续你的代码,初始化 _act_act=new Activity(context);

于 2013-09-16T13:45:14.670 回答