繁体   English   中英

addPeriodicSync触发初始同步

[英]addPeriodicSync to trigger an initial sync

创建定期同步后,是否可以立即触发同步过程?

ContentResolver.setSyncAutomatically(account, DbContentProvider.AUTHORITY, true);
// Make this run a sync job...
ContentResolver.addPeriodicSync(account, DbContentProvider.AUTHORITY, bundle, 60);

这将立即触发同步

        Bundle bundle = new Bundle();
        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_FORCE, true);
        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
        ContentResolver.requestSync(account, DbContentProvider.AUTHORITY, bundle);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM