从&QUOT取地址; canonical_addresses"表 [英] Fetch address from "canonical_addresses" table

查看:162
本文介绍了从&QUOT取地址; canonical_addresses"表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的Andr​​oid应用程序。我拿来从以下URI recipient_id。

I am working on an Android application. I fetched recipient_id from the following uri.

content://mms-sms/conversations?simple=true

现在我要来从canonical_addresses 地址表使用收件人的ID,但我没有任何想法查询canonical_addresses表。我搜索了很多网站。请帮我找到解决办法的朋友。

Now I want to fetch the address from canonical_addresses" table using the recipient id. But I don't have any idea to query canonical_addresses table". I searched a lot in web. Please help me to find a solution friends.

推荐答案

规范表有两列, _id 地址。当你的收件人ID,你做一个查找,该ID在规范的地址表。对于多个收件人ID被用空格隔开,所以你必须要拆分的结果如

Canonical table has two columns, _id and address. When you get recipient id you do a lookup for that id in the canonical addresses table. For multiple recipients the ids are separated by a space, so you'll have to split the result like

recipient_ids.split()

和查找每个ID。

getContentResolver().query(Uri.parse("content://mms-sms/canonical-addresses"), null, "_id = " + recipientId, null, null);

getContentResolver().query(Uri.parse("content://mms-sms/canonical-address/" + recipientId), null, null, null, null);

这篇关于从&QUOT取地址; canonical_addresses"表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆