Android: Get updated and deleted contact only

前端 未结 1 677
故里飘歌
故里飘歌 2021-02-06 10:40

I am developing an application in which i am working on Android Contacts and not able to move ahead. In app the need of application is that the contact which is updated should s

1条回答
  •  渐次进展
    2021-02-06 11:08

    use the below query to get all the deleted and updated contacts.

    public static final String ACCOUNT_TYPE = "com.android.account.youraccounttype"
    public static final String WHERE_MODIFIED = "( "+RawContacts.DELETED + "=1 OR "+
                RawContacts.DIRTY + "=1 ) AND "+RawContacts.ACCOUNT_TYPE+" = '"+ ACCOUNT_TYPE+"'";
    
    c = contentResolver.query(ContactsContract.RawContacts.CONTENT_URI,
                        null,
                        WHERE_MODIFIED,
                        null,
                        null);
    

    0 讨论(0)
提交回复
热议问题