How to get the latest change date for a contact list (Add / Remove / Change)

How can I find out the last date when the contact table was closed? I tried ContactsContract.RawContacts.VERSION and CONTACT_STATUS_TIMESTAMP , but it seems that they are used to know the changed date for one contact, and this does not work well with me. how can i get the last modified date for any contact in my contact list

+4
source share
1 answer

Finally, I created a String array in all versions of contacts that I have, since this is the same, it means that the contact table has not been changed, I have not found another 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(); } 
+3
source

Source: https://habr.com/ru/post/1413751/


All Articles