Reg : Contact changes in Android

Posted by Laxman on Stack Overflow See other posts from Stack Overflow or by Laxman
Published on 2010-05-05T05:10:25Z Indexed on 2010/05/05 5:18 UTC
Read the original article Hit count: 323

Filed under:
|
|
|

Hi, I am using ContentObserver on contacts. But here my problem is atleast once i have to launch my application other wise i am unable to get notification chages. My code like this

ContactsContentObserver cco = new ContactsContentObserver(handler);

    ContentResolver contentResolver = getContentResolver();

    contentResolver.registerContentObserver(RawContacts.CONTENT_URI,
    true, cco);

            }

private class ContactsContentObserver extends ContentObserver 
{
 public ContactsContentObserver(Handler h) 
 {
      super(h);
    }

    public void onChange(boolean selfChange) 
    {
       System.out.println("##########SOMEBODAY CHANGED ANYTHING AT THE CONTACTS");
       Toast.makeText(getApplication(),"####Updated####",Toast.LENGTH_LONG).show();


       }

.... Adv thanks. u can contact on [email protected]

© Stack Overflow or respective owner

Related posts about android

Related posts about contact