Android endCurrentSession(false)停止强制转换

Android endCurrentSession(false)停止强制转换,android,chromecast,google-cast-sdk,Android,Chromecast,Google Cast Sdk,我正在使用SessionManager管理Chromecast设备的Cast会话。在我的活动onPause()中,我有以下代码: val sessionManager = castContext.sessionManager sessionManager.removeSessionManagerListener(castSessionManagerListener, CastSession::class.java) sessionManager.endCurrentSession(false)

我正在使用SessionManager管理Chromecast设备的Cast会话。在我的活动
onPause()
中,我有以下代码:

val sessionManager = castContext.sessionManager
sessionManager.removeSessionManagerListener(castSessionManagerListener, CastSession::class.java)
sessionManager.endCurrentSession(false)
我发现接收器应用程序停止了。我查了一下,上面写着:

public void endCurrentSession (boolean stopCasting)

Ends the current session.
stopCasting     Should the receiver application be stopped when ending the current Session.

即使我使用了
false
,它仍然会停止接收器应用程序。为什么?我希望接收方应用程序保持流式传输,即使我的应用程序处于后台或完全关闭。例如,YouTube应用程序就是这样工作的。

我找到了自己的解决方案来避免这种情况。但它要求不使用mediaRouter。请选择(您需要的路由)。相反,我使用castContext.startSession(intent)。如果你愿意,我可以在这里写更多。