Beispiel #1
0
 public void OnServiceConnected(ComponentName name, IBinder service)
 {
     Binder = service as DroidCoreServiceBinder;
     if (Binder != null)
     {
         ServiceConnected.OnNext(Binder.Services);
         ServiceConnected.OnCompleted();
     }
 }
Beispiel #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);
 }
Beispiel #3
0
 public void OnServiceDisconnected(ComponentName name)
 {
     Binder = null;
     ServiceDisconnected.OnNext(this);
     ServiceDisconnected.OnCompleted();
 }