public void OnServiceConnected(ComponentName name, IBinder service) { StockServiceBinder stockServiceBinder = service as StockServiceBinder; if (stockServiceBinder != null) { StockServiceBinder binder = (StockServiceBinder)service; _mainActivity.Binder = binder; _mainActivity.IsBound = true; } }