开发者

Android Sync adapter runs all the time

开发者 https://www.devze.com 2023-03-05 01:57 出处:网络
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 secon

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 pe开发者_StackOverflow中文版riod 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号