从本地SQLite数据库扩展的ListView填充
我要寻找的使用本地SQLite数据库扩展列表视图的教程。
I am looking for a tutorial for expandable list view using local sqlite database.
我理解到现在什么是以下
What I understood till now, is the following
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);
}
我的问题是你如何得到父游标和子光标,然后将它们链接到对方。
My question is how do you get the parent cursor and child cursor and then link them to each other.
有一个名为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,我怎么做绑定。一直在寻找很久没有得到的东西寻找。
After this I should bind it with the ui, how do I do that. have been searching for long time not getting the stuff looking for.
创建一个新的光标你getChildrenCursor就像你一样对组内,但使用WHERE SQL语句在你的采摘更具体的!看到这个PAGE为code样本。
Create a new cursor inside your getChildrenCursor just like you did for the group, but use a WHERE sql statement to be more specific in your pickings! See this PAGE for code sample.