public void OnServiceConnected(ComponentName name, IBinder service) { var dataServiceBinder = service as DataServiceBinder; if (dataServiceBinder != null) { Binder = (DataServiceBinder)service; IsConnected = this.Binder != null; } string message = "onServiceConnected - "; Log.Debug("DataServiceConnection", $"OnServiceConnected {name.ClassName}"); if (IsConnected) { message = message + " bound to service " + name.ClassName; //mainActivity.UpdateUiForBoundService(); } else { message = message + " not bound to service " + name.ClassName; //mainActivity.UpdateUiForUnboundService(); } Log.Debug("DataServiceConnection", message); }
public void OnServiceDisconnected(ComponentName name) { IsConnected = false; Binder = null; Log.Debug("DataService", "OnServiceDisconnected called"); }