Пример #1
0
 public override void OnReceive(Context context, Intent intent)
 {
     if (intent.Action == Intent.ActionBootCompleted)
     {
         if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
         {
             JobService.EnqueueWork(context, new Intent());
         }
         else
         {
             context.StartService(BtService.GetServiceIntent(context));
         }
     }
 }
Пример #2
0
 protected override void OnHandleWork(Intent intent) =>
 BaseContext.StartForegroundService(BtService.GetServiceIntent(BaseContext));