Not a complete answer, but perhaps useful:
// Let user select (multiple) from a list of contacts with email addresses Intent i = new Intent(Intent.ACTION_GET_CONTENT, Email.CONTENT_URI); startActivityForResult(Intent.createChooser(i, ""), MY_RESULT_1);
In onActivityResult, you apparently just get a Uri (in data.getData ()), which represents the entire set of contacts. Excellent.
On HTC Desire / Froyo, data.getExtras () contains three lists of ArrayLists, one of which seems to contain the identifier of the records selected by the user.
Set<String> keys = data.getExtras().keySet(); ArrayList<Integer> ids = null; for (String s : keys) { Object o = data.getExtras().get(s); if (o instanceof ArrayList) { ArrayList a = (ArrayList) o; if (a.size() > 0 && a.get(0) instanceof Integer) { ids = a; } } }
You can use them to filter the result of the query request data.getData () Uri.
Not really, and maybe HTC. You can vary.
If someone can point out a smarter way, I'm a happy listener :)
source share