WEB开发网
开发学院手机开发Android 开发 Android ExpandableListView / ExpandableListAct... 阅读

Android ExpandableListView / ExpandableListActivity 使用及数据更新

 2010-08-21 06:33:00 来源:WEB开发网   
核心提示:}@Overridepublic boolean isChildSelectable(int groupPosition, int childPosition) {// TODO Auto-generated method stubreturn true;}}public class InfoDetailsAdapte

}

@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,

上一页  1 2 3 4 5 6 7 8 9  下一页
赞助商链接