adool adool - 10 months ago 62
Android Question

how can i get phone number of selected contact

c.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//Intent i = new Intent(ContactsContract.Contacts.CONTENT_TYPE);
Intent i = new Intent(Intent.ACTION_PICK);
startActivityForResult(i, CONTACT_PICKER_RESULT); }
public void onActivityResult(int requestCode ,int resultCode ,Intent data) {
if ((requestCode == CONTACT_PICKER_RESULT) && (resultCode == RESULT_OK)) {



This code contains the intent opens the contacts but I need if select contact take a contact phone number then set it to string

Answer Source

Check this solution: How to call Android contacts list? Its pretty much what you need to do but instead name you should search the number with the cursor.

PS: Next time search better, there is alot of people asking it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download