Sidenote: This question is similar in nature to e.g. Leave receiver running after sender stop , though I cannot find any mention of stop
or stopApplication
in my code. Also, though similar questions exist, they usually provide dead links and typically do not specifically address android tv receiver applications.
Scenario
- Android device A starts casting to an android TV. This causes an android TV application to be launched as the receiver application (see https://developers.google.com/cast/docs/android_tv_receiver).
- Android device B connects to the same android TV, joining the existing session
- B disconnects (cast button -> "stop casting")
What I want to happen
- Receiver-side (tv)
onSenderDisconnected
should be called only for B - Android TV application should remain running
What actually happens
- Receiver-side (tv)
onSenderDisconnected
is called for both A & B - Android TV application is closed
Question
- Why are all sender applications disconnected and the android TV application closed as soon as a single sender disconnects?
- How can I leave the android TV application running after a sender is disconnected?