Ejemplo n.º 1
0
 protected override void OnResume()
 {
     base.OnResume();
     try
     {
         RegisterReceiver(_appRestrictiosReceiver, new IntentFilter(Intent.ActionApplicationRestrictionsChanged));
     }
     catch (Exception)
     {
     }
     Restrictor.ResolveRestrictions(ApplicationContext, _eventService);
     if (_settingsService.GetSetting <bool>("IsBroadcastEnabled") && !_settingsService.GetSetting <bool>("IsForegroundServiceEnabled"))
     {
         var udpClientServiceIntent = new Intent(this, typeof(UdpClientService));
         StopService(udpClientServiceIntent);
         StartService(udpClientServiceIntent);
     }
 }
Ejemplo n.º 2
0
 public override void OnReceive(Context context, Intent intent) => Restrictor.ResolveRestrictions(context, MainActivity.Container.Resolve <IEventService>());