2

我有一组一个孩子,另一组有 2 个孩子,但我没有让那个孩子在 android 的可扩展视图中。

int catList = RemoveDuplicateCat.size();
for (int j = 0; j < catList; j++) 
                    {
                        categoryName[j] = new String[1];
                        categoryName[j][0] = EduInterface.categoryNameArrayList
                                .get(j);
                        MyExpandableAdapter test= new MyExpandableAdapter();
                        int child=test.getChildrenCount(j);
                        Log.d("TAG","child: : "+j+"---"
                                + child);
                        for(int i=0;i<child;i++){
                        pointName[j] = new String[child];
                        pointName[j][i] = EduInterface.pointNameArrayList
                                .get(j);
                        pointValue[j] = new String[child];
                        pointValue[j][i] = EduInterface.pointValueArrayList
                                .get(j);
                        Log.d("TAG", j + "categoryName is ::"
                                + categoryName[j][0] + "  point value is ::"
                                + pointName[j][0] + "---" + pointValue[j][0]);
                        }
                    }

                    pointcategoryExpandableList
                            .setAdapter(new MyExpandableAdapter());
                }

public int getChildrenCount(int groupPosition) {
            /*Log.d("TAG", "Cat lenght"+pointName[groupPosition].length);
            Log.d("TAG", "Cat lenght"+categoryName[groupPosition].length);*/
            return categoryName[groupPosition].length;
        }

请就如何获得它提供一些想法。

日志猫:

06-14 01:26:25.971: D/TAG(24608): child: : 0---1
06-14 01:26:25.971: D/TAG(24608): 0categoryName is ::Category 1  point value is ::item 1---12
06-14 01:26:25.971: D/TAG(24608): child: : 1---1  //actual it has 2 child but getting 1
06-14 01:26:25.971: D/TAG(24608): 1categoryName is ::no testing  point value is ::item 2---8
4

0 回答 0