【发布时间】:2011-07-17 11:47:47
【问题描述】:
我正在寻找使用本地 sqlite 数据库的可扩展列表视图的教程。
到现在为止我的理解是这样的
private class MyTestList extends SimpleCursorTreeAdapter {
//The below is a constructor with 7 arguments with 3 for parent and 3 for child data ad layout
public MyTestList (Context ctx, Cursor groupCursor, int groupLayout,
String[] groupFrom, int[] groupTo, int childLayout, String[] childFrom,
int[] childTo) {
super(ctx, groupCursor, groupLayout, groupLayout, groupFrom, groupTo, childLayout, childFrom, childTo);
}
我的问题是如何获取父光标和子光标,然后将它们相互链接。
有一个API叫
@Override
protected Cursor getChildrenCursor(final Cursor groupCursor) {
//I suppose here I am passing the parent cursor and then retrieving the
//corresponding child cursor for the particular id ??
NOT SURE HOW DO I FILL THIS, I THINK THIS WILL HAVE SOME STRING ARRAY WITH CHILD DATA
}
在此之后我应该将它与 ui 绑定,我该怎么做。找了很久没找到要找的东西。
【问题讨论】:
标签: android sqlite expandablelistview