My suggestion are not comming
how to make clickable the search suggestion list
You can use the following method :
searchBar.setSuggestionsClickListener(object : SuggestionsAdapter.OnItemViewClickListener {
override fun OnItemDeleteListener(position: Int, v: View?) {
//on item cleared
}
override fun OnItemClickListener(position: Int, v: View?) {
//on item clicked
}})
Note that item clicks do not dismiss the suggestion list, in order to do that, you can use the following methods :
searchBar.hideSuggestionsList() -> To hide the suggestions list
searchBar.text = searchBar.lastSuggestions[position].toString() -> To move suggestion item's text to the search bar text field
listener.onTextChanged(searchBar.text) -> using an interface or something similar, you can start searching instantly after suggestion item was clicked.
Note that implementing suggestion item click listener will disable automatic item clearing on clear button click, you can use the following method :
val newList = searchBar.lastSuggestions ; newList.removeAt(position) -> create a list of the old suggestions and remove the deleted item
searchBar.updateLastSuggestions(newList) -> notify the list