Ejemplo n.º 1
0
        public async Task Start()
        {
            _taskId = UIApplication.SharedApplication.BeginBackgroundTask("SyncScheduleTask", OnExpiration);

            var task = new SyncScheduleTask();
            await task.RunSyncSchedule();

            UIApplication.SharedApplication.EndBackgroundTask(_taskId);
        }
Ejemplo n.º 2
0
        public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
        {
            Task.Run(() => {
                var task = new SyncScheduleTask();
                task.RunSyncSchedule().Wait();
            });

            return(StartCommandResult.Sticky);
        }