pancodemakes
pancodemakes

Reputation: 574

Google Cast - Cannot Resolve mSelectedDevice

I am having a problem making a Google Cast Service. I can not seem to find what to use for mSelectedDevice. Both tutorials that I am using do not provide enough explanation for this, and neither go into detail of what mSelectedDevice should be.

public class CastMediaRouterCallback extends MediaRouter.Callback{

@Override
public void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo info) {
    mSelectedDevice = CastDevice.getFromBundle(info.getExtras());
    String routeId = info.getId();
    //Startd NanoHTTPD, Find URI of photo/video, and display on Cast device
}

@Override
public void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo info) {
    teardown();
    mSelectedDevice = null;
}

}

(Tutorials I am using: https://developers.google.com/cast/docs/android_sender /// https://www.binpress.com/tutorial/building-an-android-google-cast-sender-app/161)

Upvotes: 3

Views: 139

Answers (1)

Ali Naddaf
Ali Naddaf

Reputation: 19074

mSelecteDevice is an instance variable that is of type CastDevice. Not sure what you mean by "Google Cast Service" in your question but it seems you might be better off grabbing a sample project from oue GitHub repo as your starting point.

Upvotes: 1

Related Questions