在可扩展列表中显示值

时间:2013-09-16 13:39:55

标签: android expandablelistview

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

//      
}}

任何人都可以帮助我吗???

1 个答案:

答案 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);

初始化_act