Chromecast SDK Android: getApplicationMetadata returns null

China☆狼群 提交于 2019-12-12 01:49:48

问题


In my sender app I'm using

ApplicationMetadata metadata = Cast.CastApi.getApplicationMetadata(apiClient);

while

apiClient.isConnected()

returns true and my receiver app is running on the Chromecast. When I do this, the method always returns null so the metadata object is always set to null. Is there anything else I need to do for this to work?

Thanks in advance


回答1:


There seems to be a bug there which will be addressed in the next release. Meanwhile, note that when you call Cast.CastApi.launchApplication() or Cast.CastApi.joinApplication(), you get a PendingResult object. You can set a callback on that to be notified of the result of your call; the onResult() method will be called and an ApplicationConnectionResult object will be passed to it. You can call getApplicationMetadata() on that object and that works fine (assuming you successfully launch or join an application).



来源:https://stackoverflow.com/questions/21879873/chromecast-sdk-android-getapplicationmetadata-returns-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!