我正在尝试使用ExpandableListView构建基本的Android应用程序.将数据放入视图后,我只看到组,如果我点击它们不扩展的组.
这是我的代码,有人可以帮忙吗?
适配器
public class PhraseAdapter extends BaseExpandableListAdapter {
private LayoutInflater inflater;
private List data;
public PhraseAdapter(Context context) {
inflater = LayoutInflater.from(context);
}
public void setData(List data) {
this.data = data;
}
public View inflate(int viewId) {
View view = inflater.inflate(viewId, null);
return view;
}
public void updateView(List categories) {
setData(categories);
notifyDataSetChanged();
}
static class ViewHolder {
TextView name;
}
static class ViewChildHolder {
TextView phonetix;
TextView orginal;
}
@Override
public Object getChild(int groupPosition, int childPosition) {
return data.get(groupPosition);
} …Run Code Online (Sandbox Code Playgroud)