Android Example ContactSearcher - Combines ContactsUtils with SearchView

This example uses SearchView to allow the user to search for any contact. The user can enter a substring of the contact name or one of his phone numbers.

This is a modified version of SearchView. Unlike the standard SearchView this version allows us to use different text for searching. The item itself can be any type of object.

Note that the phone number "search text" is stripped from any non-digits characters. In this implementation the query text (the user input) is not stripped, the user is expected to enter the digits only (or the contact's name).
 

Attachments

  • ContactSearcher.zip
    11.1 KB · Views: 3,057

merlin2049er

Well-Known Member
Licensed User
Longtime User
I guess it's possible to return with the contact photo as well as an email address from the contact search view?
 

RAJAN MBA

Member
Licensed User
Longtime User
How to sort contacts based on the number of times contacted? The codes below are obviously wrong and of course throw up error:

B4X:
 'listofContacts is a list
listofContacts = Contacts2.GetAll(True,False)
listofContacts.Sort(Contact.TimesContacted)
and
B4X:
'listofContacts is a list
listofContacts = Contacts2.GetAll(True,False)
listofContacts.SortType("TimesContacted",True)
 
Top