Android ExpandableListView / ExpandableListActivity 使用及数据更新
2010-08-21 06:33:00 来源:WEB开发网}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
// TODO Auto-generated method stub
return true;
}
}
public class InfoDetailsAdapter extends BaseExpandableListAdapter {
Activity activity;
public InfoDetailsAdapter(Activity a){
activity = a;
}
//child method stub
@Override
public Object getChild(int groupPosition, int childPosition) {
// TODO Auto-generated method stub
return child.get(groupPosition).get(childPosition);
}
@Override
public long getChildId(int groupPosition, int childPosition) {
// TODO Auto-generated method stub
return childPosition;
}
@Override
public int getChildrenCount(int groupPosition) {
// TODO Auto-generated method stub
return child.get(groupPosition).size();
}
@Override
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
String string = child.get(groupPosition).get(childPosition);
return getGenericView(string);
}
//group method stub
@Override
public Object getGroup(int groupPosition) {
// TODO Auto-generated method stub
return group.get(groupPosition);
}
@Override
public int getGroupCount() {
// TODO Auto-generated method stub
return group.size();
}
@Override
public long getGroupId(int groupPosition) {
// TODO Auto-generated method stub
return groupPosition;
}
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
Tags:Android ExpandableListView ExpandableListActivity
编辑录入:coldstar [复制链接] [打 印]更多精彩
赞助商链接