私は拡張するクラス(ExpandableListDataClass)を持っていますBaseExpandableListAdapter
以下のようなものからExpandableListDataClassを呼び出しています。Activity
ExpandableListDataClass expandableListDataClass = new ExpandableListDataClass(this, categories);
categoryExpandableListView.setAdapter(expandableListDataClass);
カテゴリは文字列配列です。つまり、 ExpandableListDataClassのgroupCountはカテゴリに依存し。最悪なのは、GridView
でグループアイテムを展開するためにをExpandableListView
。それらGridView
は、カテゴリに応じて表示するデータが異なります。
内部getChildView()
で次のコードを使用すると、完全に機能します
if(getGroup(groupPosition).toString().equals("ebooks")){
expandableListInsideGridView.setAdapter(eBooksImageAdapterForExpandableList);
}else if(getGroup(groupPosition).toString().equals("ebrochures")){
expandableListInsideGridView.setAdapter(eBrochuresImageAdapterForExpandableList);
}
しかし、そこから削除したいのはeBooksImageAdapterForExpandableListとeBrochuresImageAdapterForExpandableListです。今私がやっていることはArrayList
、既存のカテゴリーに従って作成しているからです。しかし、categories / groupCountがいくつあるかわからない場合は、それができません。
解決策を教えてください