Java CursorTreeAdapter和getChildType

Java CursorTreeAdapter和getChildType,java,android,android-cursoradapter,Java,Android,Android Cursoradapter,我正在尝试对两种不同类型的子项使用自定义游标reeadapter。 我想在newChildView方法中使用getChildType(int-groupPosition,int-childPosition)方法 @Override protected View newChildView(Context context, Cursor cursor,boolean isLastChild, ViewGroup parent) { View view = null; swi

我正在尝试对两种不同类型的子项使用
自定义游标reeadapter
。 我想在
newChildView
方法中使用
getChildType(int-groupPosition,int-childPosition)
方法

 @Override
 protected View newChildView(Context context, Cursor cursor,boolean isLastChild, ViewGroup parent)   {
    View view = null;

    switch(getChildType(**groupPosition**, cursor.getPosition())){
    case TYPE_CHILD_1:
        view = inflater.inflate(...);
    break;
    case TYPE_CHILD_2:
        view = inflater.inflate(...);
    break;
    }
    return view;
}
但是
newChildView
方法中没有
grouppositionarg
。如何获取
groupPosition

检查bindView方法

public void bindView(View arg0, Context arg1, Cursor arg2)
{
    int pos = arg2.getPosition();
}

这里arg2代表组。

CursorTreeAdapter只有bindChildView和bindGroupView方法。这些方法在newChildView之后调用。