【发布时间】:2013-07-31 19:07:47
【问题描述】:
大家好,我在这个主题上搜索了很多仍然无法解决这个问题。我在 android 中很新。我没有在我的 ExpandableListView 中获得 Parent 的位置,我得到的是 childPosition 的值,但不是 groupposition。
catlist = (ExpandableListView) findViewById(R.id.category_list);
final ExpandableListAdapter expListAdapter = new ExpandableListAdapter(
CatergoryActivity.this, groupList, expandableCategories);
catlist.setAdapter(expListAdapter);
catlist.setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent,
View v, int groupPosition, int childPosition,
long id) {
Intent nextact = new Intent(CatergoryActivity.this,
MobileActivity.class);
String childPosition = expListAdapter.getChild(groupPosition, childPosition);
System.out.println("childPosition------------------------>>>>>>>>>>>>"+childPosition);
nextact.putExtra("locId", locId);
nextact.putExtra("childpos",
childList.get(childPosition));
nextact.putExtra("grouppos", gruopPosition);
startActivity(nextact);
return false;
}
});
【问题讨论】:
标签: android expandablelistview