Does anyone have an examples for using the BaseExpandableListAdapter with Mono for Android. I’m trying to implement this for one of my views, but am having issues with finding something that is thorough. Can anyone provide any examples on how they got this working with Mono for Android?
Does anyone have an examples for using the BaseExpandableListAdapter with Mono for Android. I’m
Share
Here’s an admittedly crude looking but functional example of using a custom expandable list adapter. You can think of the data source as being a list of lists, since each item will expand to display a list of items underneath it. To represent that, we’ll use this simple model:
Using that model you can then create a class that inherits from BaseExpandableListAdapter and implements all the required methods/properties:
The constructor for the adapter takes in a list of groups, and uses that to implement the methods that ask for a group, item, etc. To keep things simple, for each view I’m just rendering a single TextView but you can create/inflate any view you want for the items.
To demonstrate this in action, here’s a sample activity that will load up an expandable list with some data: