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 6672423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:30:23+00:00 2026-05-26T03:30:23+00:00

Basically things are more like black and white, on one phone (Galaxy S) works

  • 0

Basically things are more like black and white, on one phone (Galaxy S) works fine and on another (Nexus one, my client’s of course) it doesn’t.

First I show a list of Contacts that have phone numbers. The user chooses to backup a contact and I try to load all contact info to store it in a local database

cursor = contentResolver.query(ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id), null, null, null, null);

if (cursor != null && cursor.getCount() >0)
{
    cursor.moveToFirst();

    id = cursor.getLong(cursor.getColumnIndex(ContactsContract.Contacts._ID));
    //get all the things I need like phones, picture, etc

}

Using this id I try to get the contact’s group id

cursor = contentResolver.query(ContactsContract.Data.CONTENT_URI,
                     null,
                     ContactsContract.Data.RAW_CONTACT_ID
                        + "="
                        + id
                        + " AND "
                        + ContactsContract.Data.MIMETYPE
                        + "='"
                        + ContactsContract.CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE
                        + "'",
                        null,
                        null);
            if (cursor != null && cursor.getCount() >0)
            {
                cursor.moveToFirst();

                groupId= cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DATA1));
                cursor.close();
            }

Well, testing by adding a new contact, on my phone I get groupId=1, meaning System:My Contacts. On the Nexus One, I get null for group id. Of course, restoring in on my phone works fine, and on the other phone, the contact is not visible because it doesn’t belong to any visible groups…

Any ideas ?

  • 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-26T03:30:24+00:00Added an answer on May 26, 2026 at 3:30 am

    The problem was a misunderstanding… I needed to get RAW Contact ID and I used ContactID.. so, before searching for GroupId I needed to obtain Contact Raw Id

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

Sidebar

Related Questions

I'm trying to make the so called fine tune thing. Basically this looks like:
Basically it breaks down like this: A master template page is loaded when one
I basically want to make things easier by just looping LinkButtons instead of making
Basically I'm making a list view that you can add things to the top
I am trying to write an Add-In to PowerPoint that does basically one thing:
I have one line of code which seems commented. Basically the thing I want
This question is more or like of a confirmation. I plan to make a
So basically I want to write a function that can be written like this:
It seems like more and more OS X apps these days are doing all
So i have been creating this framework thing that basically puts together source code

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.