protected override void OnResume() { base.OnResume(); Tracking.StartUsage(this); CheckApp(); CustomContentResolver.GetCustomContentResolver(this).Sync(this); var result = modelActivity.dbGenericActivity.GetUsersIDsLogged(); if (result == null || result.Count <= 0) { StartActivity(typeof(Login)); OverridePendingTransition(Resource.Animation.abc_slide_in_top, Resource.Animation.abc_slide_out_top); Finish(); } modelActivity.myToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(modelActivity.myToolbar); if (controller.IsHrDeAlmoco()) { IniPopUpAlmoco(Resources.GetString(Resource.String.dialog_confirm_end_almoco)); } if (isToRunning || (modelActivity.dialog == null || !modelActivity.dialog.IsShowing)) { if (Sincronizador.context == null || Sincronizador.context != ApplicationContext) { Sincronizador.context = ApplicationContext; } Sincronizador.TryExecSync(); } }
public static void TryExecSync() { if (!CustomContentResolver.GetCustomContentResolver(context).IsRunning()) { #pragma warning disable RECS0002 // Convert anonymous method to method group new Thread(new ThreadStart(() => ExecSync())).Start(); #pragma warning restore RECS0002 // Convert anonymous method to method group } }