Android里边如何使用二级列表
16lz
2021-01-23
一、编写布局
二、准备数据
// 大分组List
三、关联数据
// 关联数据SimpleExpandableListAdapter adapter = new SimpleExpandableListAdapter(this,group, android.R.layout.simple_expandable_list_item_1,new String[]{“group”},new int[]{android.R.id.text1},child,android.R.layout.simple_expandable_list_item_1,new String[]{“child”},new int[]{android.R.id.text1});ExpandableListView expandableListView = findViewById(R.id.expandable_listview);expandableListView.setAdapter(adapter);
四、查看效果
更多相关文章
- Android 数据查询query函数参数解析
- Android向服务器提交数据(方式:get、post、AsyncHttpClient )
- Android 登陆、提交数据或者加载数据时提示页面
- Android中解析json数据的方式之一:Gson
- Android应用开发基础之数据存储和界面展现(一)
- Android Bluetooth蓝牙开发:Bluetooth蓝牙设备之间数据传输(4)
- 利用JDBC连接服务器数据库(Android)
- Android应用数据存储几种方式(3)