开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜