我在联系人上使用 ContentObserver。但是在这里我的问题是至少一旦我必须启动我的应用程序,否则我无法获得通知费用。我的代码是这样的
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();
}
.... 高级谢谢。