HOW TO GET THE INFORMATION OF UPDATED CONTACT IN ANDROID WHENEVER WE ADD/UPDATE/DELETE ANY CONTACT IN PHONE CONTACT LIST

Allen Scott

Total Post:46

Points:324
Posted by  Allen Scott
 592  View(s)
Ratings:
Rate this:
In my implementation, i want to get the information of changed contact whenever a contact is modified or deleted in the phone contact list.Whenever we modify or delete contact, deliverSelfNotifications() and onChange() method is called but i am not getting how to get the information of this changed contact

MyContentObserver contentObserver = new MyContentObserver();
    getApplicationContext().getContentResolver().registerContentObserver(
            ContactsContract.Contacts.CONTENT_URI, true, contentObserver);
    private class MyContentObserver extends ContentObserver {
        public MyContentObserver() {
            super(null);
        }
        @Override
        public boolean deliverSelfNotifications() {
            return true;
        }
        @Override
        public void onChange(boolean selfChange) {
            super.onChange(selfChange);

        }
    }
Please help
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: How to get the information of updated contact in android whenever we add/update/delete any contact in phone contact list

    see android.database.ContentObserver + android.database.CursorJoiner, google will help you on how to use it 

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!