Skip to content

Setting CustomSuggestionAdapter #152

@hawajka76

Description

@hawajka76

Hello,
I am trying to define a customsuggestionadapter using the method MaterialSearchBar.setCustomSuggestionAdapter
searchBar.setCustomSuggestionAdapter(suggestionsAdapter)

I am trying to implement my own callbacklisteners for the custom suggestion adapter which implements com.mancj.materialsearchbar.adapter.SuggestionsAdapter

suggestionsAdapter = DefaultSuggestionsAdapter(LayoutInflater.from(context)) .setListener(object: SuggestionsAdapter.OnItemViewClickListener{ override fun OnItemClickListener(position: Int, v: View?) { TODO("Not yet implemented") } override fun OnItemDeleteListener(position: Int, v: View?) { TODO("Not yet implemented") } })

When I do this however I get an error saying Type mismatch: inferred type is Unit but SuggestionsAdapter<*, *>? was expected

I'm somewhat new to Android programming, so I suspect I'm missing something simple. What could be a good way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions