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

  • Home
  • SEARCH
  • 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 7736857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:50:58+00:00 2026-06-01T07:50:58+00:00

I have created an application for ContactsContract… I have created a spinner which brings

  • 0

I have created an application for ContactsContract… I have created a spinner which brings all the accounts configured and hence the user can pick up the contact type say, gmail(com.google), phoneBook and so on….

Now, If I select phoneBook, then the contact gets added in the phoneBook perfectly.
When I select gmail option, It works perfectly on my htc cell phone… The contact gets added, and after sync, I can see that in my gmail account too.

But, the same thing when I test on any of the samsung cell phones, it does not get added to the contacts of my gmail….

I am confused…

Any help is appreciated. Thanks in advance…

  • 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-06-01T07:50:59+00:00Added an answer on June 1, 2026 at 7:50 am

    Phone numbers are stored in their own table and need to be queried separately. To query the phone number table use the URI stored in the SDK variable ContactsContract.CommonDataKinds.Phone.CONTENT_URI. Use a WHERE conditional to get the phone numbers for the specified contact.

    if (Integer.parseInt(cur.getString(
           cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {
        Cursor pCur = cr.query(
        ContactsContract.CommonDataKinds.Phone.CONTENT_URI, 
        null, 
        ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?", 
        new String[]{id}, null);
        while (pCur.moveToNext()) {
        // Do something with phones
        } 
        pCur.close();
    }
    

    Perform a second query against the Android contacts SQLite database. The phone numbers are queried against the URI stored in ContactsContract.CommonDataKinds.Phone.CONTENT_URI. The contact ID is stored in the phone table as ContactsContract.CommonDataKinds.Phone.CONTACT_ID and the WHERE clause is used to limit the data returned.

    Email Addresses

    Querying email addresses is similar to phone numbers. A query must be performed to get email addresses from the database. Query the URI stored in ContactsContract.CommonDataKinds.Email.CONTENT_URI to query the email address table.

    Cursor emailCur = cr.query( 
            ContactsContract.CommonDataKinds.Email.CONTENT_URI, 
            null,
            ContactsContract.CommonDataKinds.Email.CONTACT_ID + " = ?", 
            new String[]{id}, null); 
        while (emailCur.moveToNext()) { 
            // This would allow you get several email addresses
                // if the email addresses were stored in an array
            String email = emailCur.getString(
                          emailCur.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA));
            String emailType = emailCur.getString(
                          emailCur.getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE)); 
        } 
        emailCur.close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created sample application which can call show all contacts (phone numbers). But
I have created one application which is reading outlook mail, but when user install
i have created an application where user can post message to their own wall
I have created an application in facebook,all is working fine except the publish to
I have created an application using Adobe Flex. I took all the files from
I have created an application which needs to have a profile box tab which
I have created an application that uses settings.settings to store some user specific settings
I have created an application where i am fetching some data from a webservice,which
I have created an application in Android that needs to send emails to all
I have created an application which is just a list view with some values

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.