tags:

views:

20

answers:

1

Hello.

At the moment I am trying to evaluate if it is possible to reuse the android contact search in a 3rd party application.

I got the problem that I have to implement a contact list/picker including a filtering possibility for the contacts list. That means that the standard android picker opened by an intent does not help me. So I decided to implement the list/picker on my own which is not that difficult. But I need to be able to offer the android search dialog in my own implementation as well.

So is it possible to reuse the standard contact search mechanism in an own application? (the contact search available e.g. in the default contact list) Or do I have to implement this one on my own?

Thank you very much for helping me out!

+1  A: 

I think Romain Guy mentioned this exact feature of ListView in the last Google I/O. Take a look at The world of ListView at 34min. 28sec. he describes this very nicely.

basically what you do is

  1. android:textFilterEnabled="true"
  2. and your adapter must implement Filterable - CursorAdapter and ArrayAdapter have already some basic implementation for this, but you can just implement the getFilter() in your adapter to do whatever filtering you like.

Hope that helps.

ruslanoid
Thank you for pointing me to that presentation. This shows the filtering which was not exactly what I wanted. I specifically searched for the search mechanism on the top pressing the search button.
and-dev