安卓2.2;可以同时从 2 个不同的 URI 进行查询吗?
如果您想从两个单独的 URI 获取联系人数据,您可以在单个查询中完成此操作吗?
例如:
ContentResolver cr;
Cursor emailCur = cr.query(
ContactsContract.CommonDataKinds.Email.CONTENT_URI,
null,
null,
null);
应该返回 CommonDataKinds.Email URI 的所有可用列
如果我想返回电子邮件和电话类型的所有条目怎么办?
我是否需要创建两个单独的查询并连接结果?
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?
如果您使用 ContactsContract.CommonDataKinds.Data.CONTENT_URI 并提供电子邮件和电话 mime 类型的选择,则可以通过单个查询来完成此操作。
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.