ContentResolver requestSync不适用于时间间隔

时间:2016-11-05 04:30:23

标签: android android-contentresolver android-syncadapter

public static void syncImmediately(Context context) {
    Bundle bundle = new Bundle();
    bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
    bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
    ContentResolver.requestSync(getSyncAccount(context), context.getString(R.string.content_authority), bundle);
}


 SyncRequest request = new SyncRequest.Builder().syncPeriodic(syncInterval, flexTime).setSyncAdapter(account, authority).setExtras(new Bundle()).build();
 ContentResolver.requestSync(request);

当我立即调用请求同步时它可以正常工作,但延迟一段时间间隔它不会

0 个答案:

没有答案