public static ServiceToken BindToService(Context context, IServiceConnection connection) { var activity = ((Activity)context).Parent; if (activity is null) { activity = (Activity)context; } var wrapper = new ContextWrapper(activity); wrapper.StartService(new Intent(wrapper, typeof(MusicService))); var conn = new ServiceConnection(connection); if (wrapper.BindService(new Intent(wrapper, typeof(MusicService)), conn, 0)) { _connectionMap.Add(wrapper, conn); return(new ServiceToken(wrapper)); } return(null); }