【问题标题】:GoogleApiClient seems to have no callback for the disconnect() API...?GoogleApiClient 似乎没有针对 disconnect() API 的回调...?
【发布时间】:2014-11-18 10:51:56
【问题描述】:

如果您调用 GoogleApiClient #connect(),则在调用 onConnected 回调处理程序之前,您实际上并未连接。

但是,#disconnect() API 调用似乎没有给出这样的“通知”。我是否遗漏了什么,或者假设断开连接会立即发生,因此没有回调?

我确实看到了一个#onConnectionSuspended 回调,但它似乎在您断开连接() 时没有被调用,可能是针对更特殊的情况。

感谢您的帮助。

【问题讨论】:

标签: android google-app-engine google-api google-api-java-client google-api-client


【解决方案1】:

disconnect() 调用立即返回,您可以假设任何后续调用都将失败。与服务的连接将断开,但服务可能会继续存在一段时间,完成异步任务、清理等。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-20
    • 1970-01-01
    • 2019-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多