tags:

views:

32

answers:

1

I need to list the 'Display name' of all the contacts belonging to a single account. I am planning to use a cursor adapter for populating the list and hence would require the corresponding fields (Display name, Account info) to be fetched in a single content provider querry.

Looking at the Contacts Database Structure a single table amoung Raw Contacts, Contacts and Data wont be able to provide these two parameters and hence a join is necessary. As far as i know join wont be possible to fetch the data from the content provider.

Can you please let me know the solution to the problem?

Thanks in advance.

A: 

You may request on ContactsContract.RawContacts with a selection on your account name and then on the ContactsContract.RawContacts.data table with a selection on the mime type CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE.

dco maeglin