Search code examples
androidsearchview

Search results dropdown with SearchView


I'm trying to implement a search feature in my Android application whereby the user types in an address in the action bar (using a SearchView widget) and a list of matching addresses appear below it. Basically it needs to look like a list of suggestions, but they aren't suggestions as I don't want the search to be executed until the user presses the search button or hits return (suggestions appear after every character entry). Is this possible? Or do I have to create a list view with the results that appears below the action bar?

Thanks

Nick


Solution

  • I think you can implement the suggestion listener and only launch the request when the user hits the search or return on the soft keyboard. I think you can add a OnQueryTextListener and handle the search request submit in the onQueryTextSubmit method.