I fetched all device contacts from phonebook. Now i want to fetch linked accounts(facebook,twitter,instagram,LinkedIn)urls from that particular contact that is fetched from phonebook.What should i do?
Here is the code to fetch the contacts.
public Cursor getContactsCursor(FragmentActivity activity) {
Cursor cursor = null;
try {
String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "= 0" + " OR " + ContactsContract.Contacts.IN_VISIBLE_GROUP + "= 1";
String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
ContentResolver cr = activity.getContentResolver();
return cr.query(ContactsContract.Contacts.CONTENT_URI, null, selection, null, sortOrder);
} catch (Exception e) {
AppLogger.e(Helper.class.getSimpleName(), e.getMessage());
return cursor;
}
}
Now i don't know how to fetch the accounts (like facebook, linkedin etc) linked with the particular contact.
Can someone please guide me.
Update : In below attached image, On clicking the section highlighted in red, opens the linked in user profile in browser. Hence i am willing to fetch the field which is used to open the user profile page.
Thanks in advance.
linked accounts urls
, can you post a screenshot of the info you want to query for from the Contacts app? – Shwalb