Custom search implementation with SearchView

后端 未结 2 1747
离开以前
离开以前 2021-01-18 22:29

I want to implement search in my app, but I don\'t want to use a separate Activity to display my search results. Instead, I only want to use the suggestionslist that display

2条回答
  •  被撕碎了的回忆
    2021-01-18 23:11

    What you need to create is a Content Provider. In that way you can add custom results to your SearchView and add the autocomplete feature to it whenever the User inputs something.

    If I don't remember incorrectly, in one of my projects I have done something similar, and it didn't take too long.

    I believe this could be helpful: Turn AutoCompleteTextView into a SearchView in ActionBar instead

    And also this: SearchManager - adding custom suggestions

    Hope this helps.

    N.

提交回复
热议问题