“GoogleApiClient is not connected yet” exception in Cast application

前端 未结 4 648
暖寄归人
暖寄归人 2020-12-03 15:13

I\'m developing an Android application that casts content to Chromecast. Sometimes in my com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks i

4条回答
  •  误落风尘
    2020-12-03 15:37

    From showcase app (Googlecast Github Sample CastHelloText-android ) receiver app is launched onRouteSelected (not onRouteAdded as you are doing in your code). I would try to change that. In case it does not work, I would add log lines in every method related to connection & session, and see what is happening.

    Another tip: I have had crash with stopping the application (in case chromecast device is physically plugged out from power). Solution is to putCast.CastApi.stopApplication(apiClient); inside if (apiClient.isConnected()).

提交回复
热议问题