Exemplo n.º 1
0
 public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
 {
     Monitor = new NetworkStatusMonitor(this);
     Monitor.NetworkStatusChanged += Monitor_NetworkStatusChanged;
     Monitor.Start();
     new Task(async() => await DoWork()).Start();
     return(StartCommandResult.Sticky);
 }
Exemplo n.º 2
0
 public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
 {
     monitor = new NetworkStatusMonitor(this);
     monitor.NetworkStatusChanged += Monitor_NetworkStatusChanged;
     monitor.Start();
     elTimer           = new System.Timers.Timer(5000);
     elTimer.Elapsed  += ElTimer_Elapsed;
     elTimer.AutoReset = true;
     elTimer.Enabled   = true;
     Started           = true;
     Kill = false;
     //new Task(async () => await DoWork()).Start();
     return(StartCommandResult.Sticky);
 }