需要以下拉展示动态获取到的数据,所以写了ExpandableListView的使用案例。
布局文件:
<ExpandableListView
android:id="@+id/expand_listview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
适配器:
//Group为一级数据,Child为二级数据
public class ExPandAdapter extends BaseExpandableListAdapter {
List<GroupBean.ListBean.RowsBean> mGroupdata;
List<UserListBean.ListBean.RowsBean> mchilddata;
private Context mcontext;
public ExPandAdapter(Context context,List<GroupBean.ListBean.RowsBean> data ) {
this.mGroupdata = data;
this.mcontex