private void InitiateReciever() { Task.Run(() => { NetworkHandler.InitiateReciever(); }); //.ConfigureAwait(false); }
public override StartCommandResult OnStartCommand(Intent intent, [GeneratedEnum] StartCommandFlags flags, int startId) { Task.Run(() => { // background self should be defined if (BackgroundService.Self != null) { NetworkHandler.InitiateReciever(); } // start the monitoring for the UDP packets StopSelf(); }); return(StartCommandResult.Sticky); //base.OnStartCommand(intent, flags, startId); }