Skip to content Skip to sidebar Skip to footer

Android ContentObserver Never Stopped

I implemented a ContentObserver and it worked fine. But now everytime the ContentObserver is notified for some changes in the CallLog.Calls content provider, it runs the onChange()

Solution 1:

You change DB content inside of the fillList(), so RatedCallsContentObserver.onChange() is called again and again...


Solution 2:

include a date check in this query.. android.provider.CallLog.Calls.DATE > last date

cursor = getContentResolver().query(
        android.provider.CallLog.Calls.CONTENT_URI, null, null, null,
        android.provider.CallLog.Calls.DATE + " DESC ");

hope this will help you


Post a Comment for "Android ContentObserver Never Stopped"