How to implement search view for list view?

Android list view with search functionality

  • My dynamic list view(populated from a webservice) has a AutoCompleteTextView, "Search" button. I have implemented auto complete functionality for AutoCompleteTextView, it is working properly; when i type min 2chars, the AutoCompleteTextView is displaying matching results and when i select an item from the populated list, it is automatically appearing in the AutoCompleteTextView. That is fine, now I need to implement action for my "Search" button, when I click on this button, the main list view should display the matched results only. What is the best way to do it, without calling the webservice again? Thanks in advance. -nehatha

  • Answer:

    Best Android way to do it is to use the http://developer.android.com/resources/articles/qsb.html. Basically you implement a provider to return the search results in a cursor. That cursor will be used as the source to show a list of items. And you can customize the action to be done when the user clicks on the item.

Venkat Papana at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.