Skip to content Skip to sidebar Skip to footer

Can't Fetch Phone Numbers For Linked Contacts When One Of The Groups Is Invisible

I faced with problem while fetching phone numbers for linked contacts on HTC phone. The problem only with contacts that have phone numbers in invisible group. E.g. I have contact i

Solution 1:

I had this exact same problem and searched for hours to find a solution. This is probably too late for you, but if you use the following code the facebook contacts are not included in the listing.

Please note that this uses deprecated code. I suspect, however, that we are stuck using it until facebook gets their act together and stops violating every rule Google ever made regarding contacts.

Calling code:

Intentintent=newIntent(Intent.ACTION_PICK, Contacts.Phones.CONTENT_URI);
startActivityForResult(intent, SELECT_CONTACT);

Later in onActivityResult

UricontactData= data.getData();
Cursorc=  managedQuery(contactData, null, null, null, null);
startManagingCursor(c);
if (c.moveToFirst()) {
    Stringname= c.getString(c.getColumnIndexOrThrow(People.NAME));  
    Stringnumber= c.getString(c.getColumnIndexOrThrow(People.NUMBER));
    Toast.makeText(this,  name + " has number " + number, Toast.LENGTH_LONG).show();
}

Post a Comment for "Can't Fetch Phone Numbers For Linked Contacts When One Of The Groups Is Invisible"