use of com.google.samples.apps.iosched.sync.SyncHelper in project iosched by google.
the class ForceSyncNowAction method run.
@Override
public void run(final Context context, final Callback callback) {
ConferenceDataHandler.resetDataTimestamp(context);
final Bundle bundle = new Bundle();
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
new AsyncTask<Context, Void, Void>() {
@Override
protected Void doInBackground(Context... contexts) {
Account account = AccountUtils.getActiveAccount(context);
if (account == null) {
callback.done(false, "Cannot sync if there is no active account.");
} else {
new SyncHelper(contexts[0]).performSync(new SyncResult(), bundle);
}
return null;
}
}.execute(context);
}
Aggregations