Android的联系人照片URI以查找ID [英] Android Contact Photo URI with lookup id

查看:507
本文介绍了Android的联系人照片URI以查找ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何使用该联系人的查找键查找联系人照片URI。
我已经使用联系ID已经付诸实施。但现在我希望它用,因为android的接触聚合功能查找键来实现。

I would like to know how to lookup contact photo URI using the lookup key of the contact. i have already implemented it using the contact id. but now i want it to be implemented using lookup key because of android contact aggregation feature.

我目前的执行

public Uri getPhotoUri(String lookup) 
    {

        Uri person = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long
                .parseLong(lookup));
        return Uri.withAppendedPath(person, ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
    }

在此先感谢

推荐答案

如果您在使用_id报告(Contact ID),当接触连接到其他联系人,该ID将被改变。

if you using _id(contact id), when the contact connect to another contact, this id will be changed.

所以你不必使用联系人ID。

so you dont have to use contact id.

你为什么不使用原始接触ID查找联系人ID?

why don't you use raw contact id to find contact id?

这篇关于Android的联系人照片URI以查找ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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