我如何知道联系人表的最后修改日期?我已经尝试过 ContactsContract.RawContacts.VERSION
和 CONTACT_STATUS_TIMESTAMP
但似乎这些用于了解单个联系人的修改日期,并且它对我来说效果不佳。如何获取联系人列表中任何联系人的最后修改日期
最佳答案
最后我在我拥有的所有联系人版本中创建了一个数组字符串,因为它是相同的,这意味着联系人表没有被更改,我还没有找到任何其他方式,这是我的代码
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();
}
关于android - 如何获取联系人列表的最后修改日期(添加/删除/修改),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10702547/