I need to be able to select multiple contacts in Android. The flow is like this :
This feature is already present in my Samsung Android Phone (Running 2.3 Gingerbread) when I click on "Contacts" in the Messaging app. See screenshot below :
There is not built in way of doing this, so you need to do most of the work by yourself. Luckily, it's not that hard.
Display
To Display your contacts you can use either a listview with the multi-select choice mode, or you can create a custom adapter and bind it to a regular listview. I don't think the listview with multi-select will let you put anything other than text for each row, but you'd have to dig deeper to find out.
I've used the custom adapter method for something very similar (except the multiple phone numbers part). It's pretty easy to do and I find custom adapters are really useful in the long run.
Custom Adapter Listview Tutorial
With a custom adapter setup, you can create data objects with all the information for a person including their Name and Phone Number(s). In the getView of your Custom Adapter, you can decide what/how and where to display each piece of information.
Gathering Information
You'll need to use the ContactContract API to get information for your contacts.
Reading Contact Info
Reading ALL phone numbers for a Contact
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With