public override void OnDestroy() { //unregisterCarConnectionReceiver(); //// Service is being killed, so make sure we release our resources //mPlaybackManager.handleStopRequest(null); MediaNotificationManager.StopNotification(); //VideoCastManager.getInstance().removeVideoCastConsumer(mCastConsumer); //mDelayedStopHandler.removeCallbacksAndMessages(null); Session.Release(); base.OnDestroy(); }
internal void Release() { try { mediaSessionCompat.Release(); mediaSessionCompat.Dispose(); mediaSessionCompat = null; } catch (Exception ex) { Console.WriteLine(ex); } }