static void OnAccountCreated(Account newAccount, Context context) { // Since we've created an account SunshineSyncAdapter.ConfigurePeriodicSync(context, SyncInterval, SyncFlextime); // Without calling setSyncAutomatically, our periodic sync will not be enabled. ContentResolver.SetSyncAutomatically(newAccount, context.GetString(Resource.String.content_authority), true); // Finally, let's do a sync to get things started SyncImmediately(context); }
public override void OnCreate() { base.OnCreate(); lock (syncAdapterLock) { if (sunshineSyncAdapter == null) { sunshineSyncAdapter = new SunshineSyncAdapter(ApplicationContext, true); } } }