让所有的联系人时间戳明智 [英] Getting all contacts timestamp wise

查看:157
本文介绍了让所有的联系人时间戳明智的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图让设备的排序它们的添加顺序排列的所有联系人。 我使用下面的查询:

I have been trying to get all contacts of device sorted by the order they were added. I am using following query:

Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
    String[] projection = new String[] {
            ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,
            ContactsContract.CommonDataKinds.Phone.NUMBER,
            ContactsContract.CommonDataKinds.Phone.CONTACT_STATUS_TIMESTAMP };

    Cursor c = getContentResolver().query(uri, projection, null, null,
            ContactsContract.CommonDataKinds.Phone.CONTACT_STATUS_TIMESTAMP);

这是不是在 ContactsContract.CommonDataKinds.Phone.CONTACT_STATUS_TIMESTAMP 中的任何差异是否我传递查询的排序顺序

It is not making any difference whether I am passing null or ContactsContract.CommonDataKinds.Phone.CONTACT_STATUS_TIMESTAMP in the sort order of the query

检查后,光标有中的所有timestamp列。有没有办法得到这个工作或我在做什么错呢?

After inspection, the cursor has null in all timestamp columns. Is there a way to get this done or what I am doing wrong in this?

推荐答案

这是时间戳该联系人的状态更新。你得到空,可能是因为没有任何接触的有状态更新。

That is the timestamp for the status update for the contact. You are getting null probably because none of the contacts have status updates.

由于如何接触聚集,我不认为有一种方法来找出哪些联系人加入首先是因为一个联系人的ID可以真正改变,并出现添加晚于它原来是。为什么你要弄清楚这些信息呢?

Because of how contacts are aggregated, i don't think there is a way to find out which contact was added first because a contact's ID can actually change and appear to be added later than it originally was. Why do you want to figure this information out?

这篇关于让所有的联系人时间戳明智的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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