Closed velialan closed 3 years ago
SyncService.java
ContentResolver.setMasterSyncAutomatically(true);
public static void sync(Account account, String authority, boolean manual) { // Pass the settings flags by inserting them in a bundle Bundle settingsBundle = new Bundle(); settingsBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, manual); settingsBundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, manual); settingsBundle.putBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY, false); settingsBundle.putBoolean(ContentResolver.SYNC_EXTRAS_UPLOAD, true); /* * Request the sync for the default account, authority, and * manual sync settings */ ContentResolver.setMasterSyncAutomatically(true);// enables AutoSync ContentResolver.requestSync(account, authority, settingsBundle); }
app sync setting auto enabled solved my problem
SyncService.java
ContentResolver.setMasterSyncAutomatically(true);
app sync setting auto enabled solved my problem