I'm following the SyncAdapter tutorial at https://developer.android.com/training/sync-adapters/index.html. So I've got all of the Stub classes in place, and it's all wired up. The SyncAdapter itself is the one from the tutorial, so does nothing but log a message. The following all work:-

  1. The account is visible in settings/accounts
  2. Disabling/enabling sync in settings causes a sync
  3. Choosing "sync now" causes a sync
  4. Calling mResolver.requestSync(mAccount, AUTHORITY, settingsBundle); causes a sync

However, that's as far as it goes. I'm expecting network events, (eg WiFi becoming available) to trigger a sync, but it isn't.

Have I misunderstood what mResolver.setSyncAutomatically(mAccount,AUTHORITY,true); does, or is there something else preventing automatic syncing?

Related posts

Recent Viewed