Gallery 的 Demo(12)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-18 11:34 点击:次
int childPos = ExpandableListView.getPackedPositionChild(info.packedPosition);
Toast.makeText(this, title + " - Group Index: " + groupPos + " Child Index: " + childPos, Toast.LENGTH_SHORT).show();
return true;
} else if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
int groupPos = ExpandableListView.getPackedPositionGroup(info.packedPosition);
Toast.makeText(this, title + " - Group Index: " + groupPos, Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
public class MyExpandableListAdapter extends BaseExpandableListAdapter {
// 父列表数据
private String[] groups =
{
"group1",
"group2",
"group3",
"group4"
};
// 子列表数据
private String[][] children =
{
{ "child1" },
{ "child1", "child2" },
{ "child1", "child2", "child3" },
{ "child1", "child2", "child3", "child4" }
};
@Override
public Object getChild(int groupPosition, int childPosition) {
相关新闻>>
- 发表评论
-
- 最新评论 更多>>