使用expandablelistview在android中的其他组中动态创建组。
我已经成功地开发了一个可扩展的ListView。现在我需要在另一个expandablelistview中使用expandablelistview。如何在android expandablelistview中的其他组中创建组。请帮帮我。如何实现它 这是我创建两个组(orderinfo、customerinfo)的代码使用expandablelistview在android中的其他组中动态创建组。,android,expandablelistview,Android,Expandablelistview,我已经成功地开发了一个可扩展的ListView。现在我需要在另一个expandablelistview中使用expandablelistview。如何在android expandablelistview中的其他组中创建组。请帮帮我。如何实现它 这是我创建两个组(orderinfo、customerinfo)的代码 final LayoutInflater LayoutInflater=(LayoutInflater)this.getSystemService(Context.LAYOUT\u
final LayoutInflater LayoutInflater=(LayoutInflater)this.getSystemService(Context.LAYOUT\u INFLATER\u SERVICE);
最终ArrayList headerData=新ArrayList();
final HashMap group1=新HashMap();
组1.put(名称,“订单信息”);
headerData.add(第1组);
final HashMap group2=新HashMap();
组2.put(名称“CustomerInfo”);
headerData.add(第2组);
现在我需要在创建的另外3个组中实现customerinfo。如何做到这一点。请给我示例代码。如果您只想要一个标准的可扩展列表视图,我建议查看示例: 路径:android sdk\samples\android-8\ApiDemos\src\com\example\android\api\view
- ExpandableList1.java
- ExpandableList2.java
- ExpandableList3.java
final LayoutInflater layoutInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final ArrayList<HashMap<String, String>> headerData = new ArrayList<HashMap<String, String>>();
final HashMap<String, String> group1 = new HashMap<String, String>();
group1.put(NAME, "OrderInfo");
headerData.add( group1 );
final HashMap<String, String> group2 = new HashMap<String, String>();
group2.put(NAME, "CustomerInfo");
headerData.add( group2);