Question

If you want to obtain contacts data from two separate URIs, can you do this in a single query?

For example :

    ContentResolver cr;
    Cursor emailCur = cr.query( 
            ContactsContract.CommonDataKinds.Email.CONTENT_URI, 
            null,
            null, 
                    null); 

Should return all available columns against the CommonDataKinds.Email URI

What if I want to return all entries from both the Email AND Phone kind?

Would I need to create two separate queries, and concatenate the results?

Was it helpful?

Solution

You can do it with a single query if you use ContactsContract.CommonDataKinds.Data.CONTENT_URI and provide a selection for the Email and Phone mime types.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top