从&QUOT取地址; canonical_addresses"表 [英] Fetch address from "canonical_addresses" table
问题描述
我工作的Android应用程序。我拿来从以下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屋!