Пример #1
0
 public void OnServiceConnected(ComponentName name, IBinder service)
 {
     Binder = service as DroidCoreServiceBinder;
     if (Binder != null)
     {
         ServiceConnected.OnNext(Binder.Services);
         ServiceConnected.OnCompleted();
     }
 }
Пример #2
0
 public override IBinder OnBind(Intent intent)
 {
     Binder = new DroidCoreServiceBinder(this);
     if (!IsStarted)
     {
         if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O)
         {
             StartForegroundService(intent);
         }
         else
         {
             StartService(intent);
         }
     }
     return(Binder);
 }
Пример #3
0
 public void OnServiceDisconnected(ComponentName name)
 {
     Binder = null;
     ServiceDisconnected.OnNext(this);
     ServiceDisconnected.OnCompleted();
 }