DArkO
DArkO

Reputation: 16110

Android Sync adapter runs all the time

so i am running api version 7 with a custom syncAdapter service that makes calls to an API webservice to retrieve sync info. the issue with it is that this sync service starts itself every 10-30 seconds even though the sync has been successful and everything is up to date and working.

Is there anyway to define sort of a backoff period for it? is there anyway to resolve this issue? i see the syncresult variable but there isn't anything in it to indicate a successful sync or something like that.

Please help. Thanks.

Upvotes: 2

Views: 2847

Answers (1)

maxpower47
maxpower47

Reputation: 1656

You set the SyncResult variable in your onPerformSync method in your SyncAdapter. You'll see its one of the arguments to the onPerformSync method. There's a field there called delayUntil that you can use to tell it not to schedule another sync for a certain amount of time.

Upvotes: 2

Related Questions