4

I want my app to operate such that activity A starts activity B in an intent for result, where activity B is the list view where user selects multiple contacts. Then in activity A, I want to be able to extract the phone numbers in an ArrayList. There are many questions and answers around this issue on Stack Overflow. To list two:

As one still relatively new to Android development, I find the dispersed code difficult to assemble. So my question: Does anyone have a simple project that does what I seek complete, that they don't mind sharing in a zip file? In the last response in using checkbox to filter contacts and get phone number the guy claims to have such a zip project, but when I follow the link, the secondary link that should lead to the project was broken.

If someone does agree to provide a link, please let it not be a partial answer. I figure the task is simple to someone who has done it before: It's two activities, where one is a ListView allowing users to select contacts and the other is a view that displays the selected contacts. In fact, the other does not even have to display the contacts in a view, a simple println to the LogCat will suffice.

Community
  • 1
  • 1
learner
  • 11,490
  • 26
  • 97
  • 169

1 Answers1

3

This might help you. It is not what you're exactly looking for but it will give you an idea to start working with. I've used Loaders to fetch contacts from phone directory and performing search operations on it. You can use the same Loader to populate a ListView containing TextView (name/number) and CheckBox pair as list item. You can maintain a HashMap of position vs contact number for keeping track of selected contacts. Hope this helps.

EDIT

The updated link is here.

Purush Pawar
  • 4,263
  • 2
  • 29
  • 37
  • Awesome! +1. Do you mind making it available for zip download? I am usually able to click on a zip icon to get a project, I don't see one next to yours! – Katedral Pillon Apr 09 '13 at 13:25
  • @SimoneCasagranda do you mind fixing your link, too? Maybe like this link -- in a zip? – Katedral Pillon Apr 09 '13 at 13:39
  • I see the zip icon. Too bad I can't give you another +1! Thanks. (I don't even know if it works yet, just happy to see an example that I can hack thru) – Katedral Pillon Apr 09 '13 at 13:53