B4A Class Contact Picker

Hi
I convert all code about select contact to single class easily
This class need to ContactUtils.

Example :
B4X:
Dim a As ContactPicker
a.Initialize(Me,"contact")
a.ShowPicker

Sub contact_contactchooser(contact As Contact)
    Log(contact)
End Sub
 

Attachments

  • ContactPicker.bas
    1.6 KB · Views: 372
  • ContactsUtils.bas
    12.1 KB · Views: 344

Star-Dust

Expert
Licensed User
Longtime User
Put some image of the final result, it can be useful to make the idea ;)
 

fbritop

Active Member
Licensed User
Longtime User
How can we achieve multiple contacts select?
I have tried:
B4X:
i.PutExtra("additional", "phone-multi")
With no success
 

DonManfred

Expert
Licensed User
Longtime User
How can we achieve multiple contacts select?
1. You should create a new thread for any question you have
2. I don´t think it is possible. Androids Contactpicker api return ONE Result.
3. You need to build your own solution i guess. Get a List of all Contacts using ContentResolver. Or directly get a filtered list using some filters in the Content-Resolver Query. You can find some inspiration here (it is working with Google Calendars, not with Contacts. But the principle is the same. It also works with Contacts.)

Edit to add: Check ContactUtils class. It is based on contentResolver.
https://www.b4x.com/android/forum/t...-access-to-the-stored-contacts.30824/#content
You can get some inspiration here too i guess.
 
Last edited:

ronell

Well-Known Member
Licensed User
Longtime User
im having issues using this with the phone lib they both use the " contact " var
any idea how to solve?
you can edit the class file and change the variables

also, create new thread in the android question forum if you have more questions
 
Top