我必须使用下面的代码...我必须为第一组获取子值...但是在这里我必须单击第二组意味着它没有展开并且同时应用程序被强制关闭。所以请帮助我..怎么样为不同的父母设置不同的孩子价值......请给我这个示例代码......
private List createGroupList() {
Log.d(TAG, "Adding groups values");
List<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
HashMap<String, String> statusMap = new HashMap<String, String>();
statusMap.put(GroupID, "OrderInfo");
list.add(statusMap);
HashMap<String, String> usersMap = new HashMap<String, String>();
usersMap.put(GroupID, "CustomerInfo");
list.add(usersMap);
Log.d(TAG, "Adding groups values successfull");
return list;
}
private List createChildList() {
ArrayList result = new ArrayList();
for( int i = 0 ; i < 1 ; ++i ) { // this -15 is the number of groups(Here it's fifteen)
/* each group need each HashMap-Here for each group we have 3 subgroups */
ArrayList secList = new ArrayList();
for( int n = 0 ; n < 1 ; n++ ) {
HashMap child = new HashMap();
String s= getIntent().getStringExtra("payment_method");
String s1= getIntent().getStringExtra("total");
String s2= getIntent().getStringExtra("firstname");
String s3= getIntent().getStringExtra("lastname");
child.put( "KEY_ARTIST", s);
child.put( "KEY_DURATION", s1);
child.put( "KEY_FNAME", s2);
child.put( "KEY_LNAME", s3);
secList.add( child);
}
result.add( secList );
}
return result;
}