如何获得的最后修改日期为联系人列表(添加/删除/修改) [英] How to get the last modification date for Contacts list (Add/Delete/Modify)

查看:172
本文介绍了如何获得的最后修改日期为联系人列表(添加/删除/修改)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能知道联系人表是modiefied在最后的日子?我已经尝试过 ContactsContract.RawContacts.VERSION CONTACT_STATUS_TIMESTAMP 但似乎这些都是以前认识的修改日期单触点,它都不尽如人意我。我怎样才能得到最后的修改日期在联系人列表中的任何接触

How can i know the last date the Contacts table was modiefied at? i have tried ContactsContract.RawContacts.VERSION and CONTACT_STATUS_TIMESTAMP but it seems that these are used to know the modified date for a single contact, and it is not working well with me. how can i get the last modified date for any contact in the contacts List

推荐答案

最后,我已经取得了联系方式,我有所有版本的数组字符串,因为它是一样的,这意味着联系人表没有改变,我还没有发现任何其他方式,这是我的code

At last i have made an array String in all the Versions of the Contacts i have, since it is the same this means that the Contacts table has not been changed, i have not found any other way, this is my Code

private String sGetCurrentContatcsVersions() {

        Cursor allContacts = mContext.getContentResolver().query(
                ContactsContract.RawContacts.CONTENT_URI, null, null, null, null);

        StringBuilder sbCurrentVersion = new StringBuilder();
        allContacts.moveToFirst();

        for (int i = 0; i < allContacts.getCount(); i++) {

            if (!TimelineService.bScannerIsRunning) {
                break;
            }
            int col = allContacts.getColumnIndex(ContactsContract.RawContacts.VERSION);
            sbCurrentVersion.append(allContacts.getString(col));
            allContacts.moveToNext();
        }

        return sbCurrentVersion.toString();
    }

这篇关于如何获得的最后修改日期为联系人列表(添加/删除/修改)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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