각 목록에 개체 집합 (Product)이 포함 된 확장형 목록을 만듭니다. 하지만 자식 포인터를 얻으면 null 포인터 예외가 발생하고 목록을 표시하지 않습니다.확장형 목록이 표시되지 않습니다.
private Activity context;
private ArrayList<Product> allBmcList;
Map<ArrayList<Product>, List<String>> bmcCollection;
private List<String> Groups;
public ExpandableListAdapter(Activity context, List<String> groups,
Map<ArrayList<Product>, List<String>> bmcList) {
this.context = context;
this.bmcCollection = bmcList;
this.Groups = groups;
}
@Override
public int getChildrenCount(int groupPosition) {
// Below line I am getting null pointer exception.
return bmcCollection.get(Groups.get(groupPosition)).size();
}
후지도 목록, > bmcLis t 코드 –
로드가 문제가되지 않습니다. BMC 컬렉션의 가치를 얻고 있습니다. 나는 문제가 아이들 카운트를 얻는 동안에 만 있다고 생각한다. –
@u_pendra 확인 답변. – Piyush