Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Having an Adapter inheriting from BaseExpandableListAdapter is not assignable to ExpandableListView's Adapter property as it is of type IListAdapter. However the SetAdapter method correctly accepts IExpandableListAdapter, which Adapter also should.
This is observed in Xamarin.Android 4.6.00049
This isn't a bug.
ExpandableListView doesn't provide an Adapter property; the Adapter property is inherited from ListView, which provides the ListView.Adapter property.
This is also how Android does things, after a little squinting; ExpandableListView.getAdapter() likewise returns ListAdapter, _not_ ExpandableListAdapter:
This is just an override of ListView.getAdapter():
The return type of the `get` method is preferred when binding properties.
Meanwhile, ExpandableListView.setAdapter() is overloaded to accept an ExpandableListAdapter, which is the SetAdapter(IExpandableListAdapter) method you originally noted.
I confirm this bug. It is non-obvious behavior.
If ExpandableListView does not provide an Adapter property, then you must review your architecture. You can add root adaper interface, like as IListAdapter. Do not leave it so. It discredits you as software designers.