0

I use a ContentProvider to handle my data, and an AbstractThreadedSyncAdapter to sync it. In my SyncAdapter.onPerformSyncmethod, I use the ContentProviderClient parameter to add some data. However, when I update my data, my provider notifies the observers:

if (updateCount > 0)
    getContext().getContentResolver().notifyChange(uri, null);

The UI is refreshed, that's good, but… the sync adapter is notified too. And another sync is queued.

Is there any way to prevent this, ignoring (in the SyncAdapter only) the modifications done during the onPerormSync call?

Marc Plano-Lesay
  • 6,808
  • 10
  • 44
  • 75
  • 1
    http://developer.android.com/reference/android/content/ContentResolver.html#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20boolean) last param – Selvin Oct 18 '13 at 10:21
  • I noticed it. But as I'm not calling my `ContentProvider` directly, how am I supposed to toggle it? – Marc Plano-Lesay Oct 18 '13 at 11:28
  • look at this question: http://stackoverflow.com/questions/6969522/how-to-use-caller-is-syncadapter-properly – Cameron Ketcham Apr 09 '14 at 16:47

0 Answers0