how to listen for changes in Contact Database
Posted
by hap497
on Stack Overflow
See other posts from Stack Overflow
or by hap497
Published on 2009-09-09T18:26:31Z
Indexed on
2010/06/01
5:33 UTC
Read the original article
Hit count: 333
android
Hi,
I am trying to listen for any change in the contact database.
So I create my contentObserver which is a child class of ContentObserver:
private class MyContentObserver extends ContentObserver {
public MyContentObserver() {
super(null);
}
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
System.out.println (" Calling onChange" );
}
}
MyContentObserver contentObserver = new MyContentObserver();
context.getContentResolver().registerContentObserver (People.CONTENT_URI, true, contentObserver);
But When I use 'EditContactActivity' to change the contact database, My onChange function does not get called.
© Stack Overflow or respective owner