Select contact for app
I ran into this post: How to call Android contacts list?
Unfortunately I'm reading that it's old and Android 2.0 changed how this works, but this post fails to link to a new method of accomplishing this. Google also appears to either lack results, or I'm not searching for the right thing. I'd like for a user to be able to sel开发者_Go百科ect a contact on my app... how do I give them a prompt to select 1 user, then for a task to be executed when that user is selected.
You need to use StartActivityForResult
on your contact picker Intent and then you will get the result back when the user selects the contact. Here is a pretty good example
Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,
Contacts.CONTENT_URI);
startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT);
精彩评论