Wednesday, 15 January 2014

android - Retrieve those contacts from phonebook that has Social account -



android - Retrieve those contacts from phonebook that has Social account -

i have retrive contacts phonebook has social acconut whatsapp, twitter, google+ etc. there way whatsapp , social contact local phonebook itself?

i have seek next code contacts

cursor phone = getcontentresolver().query( contactscontract.commondatakinds.phone.content_uri, null, null, null, null); phone.movetofirst(); while (phone.movetonext()) { string name = phone .getstring(phone .getcolumnindex(contactscontract.commondatakinds.phone.display_name)); string phonenumber = phone .getstring(phone .getcolumnindex(contactscontract.commondatakinds.phone.number)); toast.maketext(getapplicationcontext(), "name:"+name+"number:"+phonenumber, toast.length_short).show(); contactarray.add(new getsetcontact(name, phonenumber)); } phone.close();

but code contact not contact has social business relationship whatsapp

put bundle name in query

cursor7 = getcontentresolver().query( android.provider.contactscontract.rawcontacts.content_uri, null, "account_type='package name'", null, null);

android android-contacts

No comments:

Post a Comment