开发者

How synchronization with SyncAdapter works on android?

开发者 https://www.devze.com 2023-02-22 05:26 出处:网络
If I need to start synchronization adhoc, I use requestSync. 开发者_如何学运维But looks like it doesn\'t work when setIsSyncable defined as false. How to initiate synchronization by user request in th

If I need to start synchronization adhoc, I use requestSync. 开发者_如何学运维But looks like it doesn't work when setIsSyncable defined as false. How to initiate synchronization by user request in this case?

Moreover, if after that I define setIsSyncable as true and also start period syncs with addPeriodicSync, synchronization starts 2 times.


1: To override setIsSyncable:

Add ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS set to true in the requestSync() extras Bundle.

2: Double-sync

(see comment first)

0

精彩评论

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