You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CaststateListener not getting called in Fragment.
i am calling it in onresume . when fragment starts nothing happen during onresume .But when app goes in background so onstop is being called then coming back to foreground onresume is being called , at that time listner works .
` @OverRide
public void onResume() {
super.onResume();
castContext.addCastStateListener(new CastStateListener() { @OverRide
public void onCastStateChanged(int i) {
if (i == CastState.NO_DEVICES_AVAILABLE){
mediaRouteButton.setVisibility(View.GONE);
}
else {
mediaRouteButton.setVisibility(View.VISIBLE);
}
if (CastState.CONNECTED == i){
EventTrackingManager.getEventTrackingManager(mContext).trackClickedItem(TrackingEvents.CHROMECAST_CONNECTED,null);
}
}
});
}`
The text was updated successfully, but these errors were encountered:
CaststateListener not getting called in Fragment.
i am calling it in onresume . when fragment starts nothing happen during onresume .But when app goes in background so onstop is being called then coming back to foreground onresume is being called , at that time listner works .
` @OverRide
public void onResume() {
super.onResume();
castContext.addCastStateListener(new CastStateListener() {
@OverRide
public void onCastStateChanged(int i) {
if (i == CastState.NO_DEVICES_AVAILABLE){
mediaRouteButton.setVisibility(View.GONE);
}
else {
mediaRouteButton.setVisibility(View.VISIBLE);
}
The text was updated successfully, but these errors were encountered: