Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bind a CursorAdapter to an ExpandableListView?

I can now bind a CursorAdapter to a ListView. And the ListView can update automatically when the database is modified.

For the data rows in the database has a field 'type', they can be 'Daily', 'Weekly', 'Monthly', .etc. And I want to display the rows in ExpandableListView, so that every type of rows can group together. And I also want the ExpandableListView can update automatically when the database is modified. How can I combine the CursorAdapter and ExpandableListView together?

I googled a lot, but cannot find a solution, thank you for your attention!

like image 296
ax003d Avatar asked Nov 26 '12 04:11

ax003d


1 Answers

It's referred to as a CursorTreeAdapter

http://developer.android.com/reference/android/widget/CursorTreeAdapter.html

http://developer.android.com/reference/android/widget/SimpleCursorTreeAdapter.html

like image 124
mango Avatar answered Oct 21 '22 19:10

mango