Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:46:31+00:00 2026-05-26T19:46:31+00:00

The short version of my question is: How do I access the phone numbers

  • 0

The short version of my question is: How do I access the phone numbers of contacts that were synced from 3rd party apps?

Here is the long version:

I can access the regular Android contacts pretty easily. The issue is when the only information in the contact list is synced with a 3rd party app like Facebook or LinkedIn. If I physically went and typed someone’s phone number into the Google Contacts List, everything works fine.

However, if this phone number came from syncing my facebook account to my contact list, no phone number shows up, even though if I navigated to Google’s pre-made contact list I can see a phone number is actually attached to the contact. Here is the code I use for getting the phone numbers.

public void populateNumberLists(View view)
{
    LinearLayout ll = (LinearLayout) view;
    TextView tv = (TextView) ll.findViewById(R.id.contactEntryText);

    String str = (String) tv.getText();
    Cursor cursor = getNumbers(str);

    String[] fields = new String[] {
            cursor.getColumnName(1).toString()
    };


    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.numberentry, cursor,
            fields, new int[] {R.id.numberEntryText});
    mNumberList.setAdapter(adapter);            

}

private Cursor getNumbers(String str)
{

    final Uri URIs = ContactsContract.Contacts.CONTENT_URI;
    final String ID = ContactsContract.Contacts.LOOKUP_KEY;
    String id = "";
    ContentResolver cr = getContentResolver();
    Cursor cu = cr.query(URIs, null, ContactsContract.Contacts.DISPLAY_NAME + " = '" + str + "'", null, null);

    if (cu.moveToFirst()) {
        id = cu.getString(cu.getColumnIndex(ID));
    }

    cu.close();

    // Run query
    Uri uri = Phone.CONTENT_URI;
    String[] projection = new String[] {
            Phone._ID,
            Phone.NUMBER

    };

    String selection = Phone.LOOKUP_KEY + " = '" + id + "' and (" + Phone.TYPE + " = '" + Phone.TYPE_HOME+"' or " + Phone.TYPE + " = '" + Phone.TYPE_MOBILE+"' or " + Phone.TYPE + " = '" + Phone.TYPE_WORK+"' or " + Phone.TYPE + " = '" + Phone.TYPE_WORK_MOBILE+"')";

    String[] selectionArgs = null;

    String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";


    return managedQuery(uri, projection, selection, selectionArgs, null);

}

Basically, the populateNumberLists function takes a clicked item from a list view, determines which contact from the list was clicked and calls the function getNumbers.

The getNumbers function takes actual name that was clicked, gets the lookup key for that name, then grabs all the phone numbers associated with that lookup key.

Oh, related to this, the only names displayed in the contact list are ones where ContactsContract.Contacts.HAS_PHONE_NUMBER equals 1. So I know that all the contacts that can be selected have a phone number attached.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:46:32+00:00Added an answer on May 26, 2026 at 7:46 pm

    Facebook is not included in the ContactPicker because Facebook forbid that.
    This is a politically thing and won’t be solved soon: Google wants Facebook to share data, Facebook uses Google but doesn’t share..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short version question : Is there navigator.mozIsLocallyAvailable equivalent function that works on all browsers,
I have a short version of the question: I start a thread like that:
Short version: Can I grant access to external databases to a role? Long version:
Short version of question: see title Long version of question: I've used jquery's show()
To short version of this question is that I want to accomplish something along
Ok, the short version is that I have a Linq entity from a LinqDataSourceUpdateEventArgs
Question in short: How tot do this in MVC.NET? Question in long version: Im
The short version of this question is: How can I take data that only
Short version of question: How do I get started with C programming? Note that
Original Question (long version below). Short version: Running hadoop streaming with a ruby script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.