开发者

Android 2.2; Can you query from 2 different URIs at the same time?

开发者 https://www.devze.com 2023-01-13 04:12 出处:网络
If you want to obtain contacts data from two separate URIs, can you do this in a single query? For example :

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( 
            ContactsC开发者_JAVA百科ontract.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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消