Skip to content Skip to sidebar Skip to footer

Android: How To Pick Multiple Contacts

I'm using this code to let the user choose a contact: Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, Phone.CONTENT_URI); startActivityForResult(contactPickerIntent,

Solution 1:

You won't be able to do it with the ACTION_PICK intent option. To implement this, you'll need to use a custom ListView with contacts generated from a query to the contacts content provider.

If you want to use the Intent.ACTION_PICK intent, you'll need to tell the user to pick one-at-a-time.

UPDATE:

There are several ways to do this with a custom ListView. The old way (that is compatible with most phones) is a bit lengthy to explain, but luckily there is a good tutorial here describing exactly what you're looking for (contact list with checkbox in a custom ListView).

With API 5 and above, there is a ContactsContract class that can help with getting a list of contacts. For example code on how to use this, look at android's ContactManager sample application, specifically the ContactManager class and the populateContactList() method.

The API for the ContactsContract class is here as well.

Post a Comment for "Android: How To Pick Multiple Contacts"