Extensible ListView populated from local Sqlite database

I am looking for a tutorial for extensible list browsing using a local sqlite database.

What I understood so far 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 the child cursor, and then link them together.

There is an API called

 @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 } 

After that I have to connect it with ui how to do it. searched for a long time without getting the right material.

0
source share
1 answer

Create a new cursor inside your getChildrenCursor in the same way as for the group, but use the WHERE sql statement to be more specific in your collections! See PAGE for sample code.

+1
source

All Articles