从"canonical_addresses"表中获取地址

sar*_*ath 7 android android-contentprovider

我正在开发一个Android应用程序.我从下面的uri中获取了recipient_id.

content://mms-sms/conversations?simple=true
Run Code Online (Sandbox Code Playgroud)

现在我想从canonical_addresses中获取地址" table using the recipient id. But I don't have any idea to query canonical_addresses table".我在网上搜索了很多.请帮我找个解决方案的朋友.

vik*_*kki 13

规范表有两列,_idaddress.获得收件人ID后,您将在规范地址表中查找该ID.对于多个收件人,ID由空格分隔,因此您必须将结果拆分为

recipient_ids.split(" ")

并查找每个id.

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

要么

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