How to bind a CursorAdapter to an ExpandableListView?
Asked Answered
F

1

11

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!

Floury answered 26/11, 2012 at 4:4 Comment(2)
Is there a reason to not use one of the platform's adapters specially designed for an ExpandableListView?Trichloroethylene
No, I should use CursorTreeAdapter. But I only get to know it just now! @LuksprogFloury

© 2022 - 2024 — McMap. All rights reserved.