When i try to set the adapter to my ExpendableListView it expects ListAdapter but i want to use a custom ExpandableListAdapter which extends BaseExpandableListAdapter
This is my ExpandableListView:
<ExpandableListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:layout_marginTop="160dp"
android:id="@+id/exp_lv_nav">
</ExpandableListView>
Setting the adapter:
exp_lv_nav.adapter = ExpandableListAdapter(this, listDataHeader, listDataChild, exp_lv_nav)
And this is what I get when building:
Error : Type mismatch: inferred type is ExpandableListAdapter but ListAdapter! was expected
Top of my adapter:
public class ExpandableListAdapter extends BaseExpandableListAdapter {
private Context mContext;
private List<ExpandedMenuModel> mListDataHeader;
private HashMap<ExpandedMenuModel, List<String>> mListDataChild;
ExpandableListView expandList;
public ExpandableListAdapter(Context context, List<ExpandedMenuModel> listDataHeader, HashMap<ExpandedMenuModel, List<String>> listChildData, ExpandableListView mView) {
this.mContext = context;
this.mListDataHeader = listDataHeader;
this.mListDataChild = listChildData;
this.expandList = mView;
}
exp_lv_nav.adapter = ExpandableListAdapter(this, listDataHeader, listDataChild, exp_lv_nav)
hmmm it doesn't looks likejava
... and if's it's Kotlin ... then ... well ....setAdapter(ListAdapter adapter)
andsetAdapter(ExpandableListAdapter adapter)
fu*** up Kotlin binding – Poundal