I'm trying to discover Chromecast device on my network, select it and use for video streaming in a newly launched activity. It all works fine until I exit my "streaming" activity and return to "discovery" activity. I start a new discovery upon return to this activity and this time it is not finding my device (onRouteAdded()
never called).
I call mMediaRouter.addCallback(mMediaRouteSelector, mMediaRouterCallback, MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN);
in onResume()
and mMediaRouter.removeCallback(mMediaRouterCallback);
in onPause()
.
Is there anything else I need to do to restart discovery process? Note that I don't use MediaCast button and handle RouteAdded/Removed and selection manually.
Thanks.
Asked
Active
Viewed 198 times
2

Simon Kuang
- 3,870
- 4
- 27
- 53

alexbtr
- 3,292
- 2
- 13
- 25