是否可以在创建定期同步后立即触发同步过程?
ContentResolver.setSyncAutomatically(account, DbContentProvider.AUTHORITY, true);
// Make this run a sync job...
ContentResolver.addPeriodicSync(account, DbContentProvider.AUTHORITY, bundle, 60);
答案 0 :(得分:0)
这将触发同步立即发生
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);