你可以在你简单的CursorTreeAdapter中推翻“儿童意见”。 这是我如何做的:
class MyAdapter extends SimpleCursorTreeAdapter {
@Override
protected void bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) {
// TODO Auto-generated method stub
super.bindChildView(view, context, cursor, isLastChild);
String title = cursor.getString(cursor.getColumnIndex(Alert.COL_DAY));
((TextView)view.findViewById(R.id.child_day)).setText(title);
}
public MyAdapter(Context context, Cursor cursor,
int groupLayout, String[] groupFrom, int[] groupTo,
int childLayout, String[] childFrom, int[] childTo) {
super(context, cursor, groupLayout, groupFrom, groupTo, childLayout, childFrom, childTo);
}
protected Cursor getChildrenCursor(Cursor groupCursor) {
int idColumn = groupCursor.getColumnIndex(Pill.COL_ID);
return Alert.list(db, groupCursor.getInt(idColumn), null, Alert.COL_DAY);
}
}
然而,在创建时,你必须提供子女退学和子女退学,以适应,从而在具有约束力的意见中加以利用。