Chromecast的SDK的Andr​​oid:getApplicationMetadata返回null [英] Chromecast SDK Android: getApplicationMetadata returns null

查看:173
本文介绍了Chromecast的SDK的Andr​​oid:getApplicationMetadata返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序发送我使用

In my sender app I'm using

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

,而

apiClient.isConnected()

返回true,我的接收器应用程序是在Chromecast运行。
当我这样做,因此元数据对象始终设置为null方法总是返回null。
还有什么,我需要为此做工作?

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?

在此先感谢

推荐答案

有似乎有一个bug,这将在未来的版本中得到解决。同时,请注意,当你调用 Cast.CastApi.launchApplication() Cast.CastApi.joinApplication(),你获得 PendingResult 对象。您可以设置上要通知您的调用结果的回调;在 onResult()方法将被调用,一个 ApplicationConnectionResult 对象将被传递给它。您可以拨打 getApplicationMetadata()的物体上,并工作正常(假设你成功启动或加入一个应用程序)。

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).

这篇关于Chromecast的SDK的Andr​​oid:getApplicationMetadata返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆