0
如何在不影響底圖數據和ChildView
上的onClick/onLongClick事件的情況下爲每個展開的ChildView
創建標題。下面是我ExpandableListView
適配器的框架實現:使用CursorTreeAdapter的ExpandableListView的子標題
私有類EAdapter擴展CursorTreeAdapter {
public EAdapter(Cursor cursor, Context context) {
super(cursor, context);
}
@Override
protected void bindChildView(View view, Context context, Cursor cursor,
boolean isLastChild) {
}
@Override
protected void bindGroupView(View view, Context context, Cursor cursor,
boolean isExpanded) {
}
ChildHolder childHolder;
@Override
protected View newChildView(Context context, Cursor cursor,
boolean isLastChild, ViewGroup parent) {
view.setTag(childHolder);
registerForContextMenu(view);
return view;
}
GroupHolder groupHolder;
@Override
protected View newGroupView(Context context, final Cursor cursor,
boolean isExpanded, ViewGroup parent) {
view.setTag(groupHolder);
return view;
}
@Override
protected Cursor getChildrenCursor(Cursor groupCursor) {
return cursor;
}
}
任何幫助/指針將是最有幫助。
我在做類似的事情http://stackoverflow.com/questions/10611927/simplecursortreeadapter-and-cursorloader – toobsco42 2012-05-16 07:31:17